Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Stream releated methods added to VlcMediaPlayer and to VlcControl (Th… #317

Merged
merged 2 commits into from
Sep 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,12 @@ public string CodecName
{
get
{
#if NET20
return string.Format(
"{0}{1}{2}{3}",
(char)(CodecFourcc & 0xff),
(char)(CodecFourcc >> 8 & 0xff),
(char)(CodecFourcc >> 16 & 0xff),
(char)(CodecFourcc >> 24 & 0xff));
#else
return string.Format(
"{0}{1}{2}{3}",
(char)(CodecFourcc & 0xff),
(char)(CodecFourcc >> 8 & 0xff),
(char)(CodecFourcc >> 16 & 0xff),
(char)(CodecFourcc >> 24 & 0xff));
#endif
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/Vlc.DotNet.Core/VlcMediaPlayer/VlcMediaPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ public VlcMedia SetMedia(string mrl, params string[] options)
return SetMedia(new VlcMedia(this, mrl, options));
}

public VlcMedia SetMedia(Stream stream, params string[] options)
{
return SetMedia(new VlcMedia(this, stream, options));
}

private VlcMedia SetMedia(VlcMedia media)
{
var currentMedia = GetMedia();
Expand Down
16 changes: 16 additions & 0 deletions src/Vlc.DotNet.Forms/VlcControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,16 @@ public void Play(string mrl, params string[] options)
}
}

public void Play(Stream stream, params string[] options)
{
//EndInit();
if (myVlcMediaPlayer != null)
{
myVlcMediaPlayer.SetMedia(stream, options);
Play();
}
}

public void Pause()
{
//EndInit();
Expand Down Expand Up @@ -431,6 +441,12 @@ public void SetMedia(string mrl, params string[] options)
//EndInit();
myVlcMediaPlayer.SetMedia(mrl, options);
}

public void SetMedia(Stream stream, params string[] options)
{
//EndInit();
myVlcMediaPlayer.SetMedia(stream, options);
}
#endregion
}
}