Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Delaire
Last active January 14, 2020 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Delaire/dfaf4e1d0e81190f69ab8a8f986499f9 to your computer and use it in GitHub Desktop.
Save Delaire/dfaf4e1d0e81190f69ab8a8f986499f9 to your computer and use it in GitHub Desktop.
public class StreamPlaybackService : INotifyPropertyChanged
{
private readonly LibVLC _libVLC;
private MediaPlayer _appMediaPlayer;
public MediaPlayer AppMediaPlayer
{
get
{
return _appMediaPlayer;
}
set
{
if (value != _appMediaPlayer)
{
_appMediaPlayer = value;
OnPropertyChanged("appMediaPlayer");
}
}
}
private StreamPlaybackService()
{
//init vlc core lib
Core.Initialize();
//init vlc media
_libVLC = new LibVLC();
//android media player
AppMediaPlayer = new MediaPlayer(_libVLC);
AppMediaPlayer.EncounteredError += AppMediaPlayer_EncounteredError;
AppMediaPlayer.Buffering += AppMediaPlayer_Buffering; ;
AppMediaPlayer.Opening += AppMediaPlayer_Opening;
AppMediaPlayer.Playing += AppMediaPlayer_Playing;
AppMediaPlayer.Paused += AppMediaPlayer_Paused;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment