Ejemplo n.º 1
0
        public void Play(PlayFinishedHandler onPlayFinished = null, VolumeMeterEventHandler preVolumeMeterHandler = null, VolumeMeterEventHandler postVolumeMeterHandler = null)
        {
            if (playbackDevice != null && fileStream != null && playbackDevice.PlaybackState != PlaybackState.Playing)
            {
                playbackDevice.Play();

                if (onPlayFinished != null)
                {
                    OnPlayFinished = onPlayFinished;
                    playbackDevice.PlaybackStopped += OnAudioPlayStopped;
                }
            }
        }
Ejemplo n.º 2
0
        public void Play(string fileName, VideoPlayFile vPlayFile, PlayFinishedHandler onPlayFinished = null)
        {
            switch (vPlayFile)
            {
            case VideoPlayFile.FileInfo:
                vlc.MediaPlayer.Play(new FileInfo(fileName));
                break;

            case VideoPlayFile.URI:
                vlc.MediaPlayer.Play(new Uri(fileName));
                break;

            case VideoPlayFile.NONE:
                vlc.MediaPlayer.Play();
                break;
            }

            if (onPlayFinished != null)
            {
                OnPlayFinished              = onPlayFinished;
                vlc.MediaPlayer.EndReached += MediaPlayer_EndReached;
            }
        }