Memory playback in Media Player SDK .Net

Related products
Media Player SDK .Net

Sample code

1. Create a stream based on the existing file
var _fileStream = new FileStream(edFilename.Text, FileMode.Open);
var _stream = new ManagedIStream(_fileStream);

MediaPlayer1.Source_Stream = _stream;
MediaPlayer1.Source_Stream_Size = _fileStream.Length;
or from the memory array (_memorySource is byte[])
var _memoryStream = new MemoryStream(_memorySource);
var _stream = new ManagedIStream(_memoryStream);

MediaPlayer1.Source_Stream = _stream;
MediaPlayer1.Source_Stream_Size = _memoryStream.Length;
2. Set audio and video availability flag
// true if the video stream is available
MediaPlayer1.Source_Stream_VideoPresent = true;

// true if the audio stream is available
MediaPlayer1.Source_Stream_AudioPresent = true;
3. Set mode
MediaPlayer1.Source_Mode = VFMediaPlayerSource.Memory_DS;
4. Start playback
Please contact support to get help with this tutorial. Visit our GitHub page to get more code samples.
abstract 2abstract 1abstract 3
VisioForge © 2006 - 2021