Memory playback in Media Player SDK .Net

Related products
Media Player SDK .Net
1. Create a stream based on 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 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 video stream available
MediaPlayer1.Source_Stream_VideoPresent = true;

// true if audio stream 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.
VisioForge © 2006 - 2021