Movie Player ActiveX Control

LoadFromByteArray

 

Load the video from byte array. It support avi, mpeg1, mpeg2, vob, wmv file only.

Public Function LoadFromByteArray( _
  ByVal ByteArray As Byte, _
  ByVal iBufferLen As long, _
  ByVal strFileType As String
)

 

Parameter
ByteArray
An Array which contains video data. 

iBufferLen
the length of buffer. 

strFileType
the type of video data.
avi- avi video
mpg - mpg video
wmv - wmv video

Return Value
True - Success, False- Failed

Example

   

Visual Basic Syntax
Dim nFileHandle As Integer
Dim arBuffer() As Byte
Dim nImageID As Long

nFileHandle = FreeFile
Open "c:\yourvideo.mpg" For Binary As #nFileHandle
ReDim arBuffer((LOF(nFileHandle)))
Get #nFileHandle, , arBuffer
Close #nFileHandle

strType = "mpg"

iSize = UBound(arBuffer)
MoviePlayer1.LoadFromByteArray arBuffer, iSize, strType
Erase arBuffer