Пример #1
0
        public void loadVideo(String video, VIDEO_STATE videoState, VideoEnded videoEnded = null)
        {
            currentPlayingVideo = video;
            Uri         pathUri = new Uri(String.Format("ms-appx:///Assets/Videos/{0}.mp4", video));
            MediaSource source  = MediaSource.CreateFromUri(pathUri);

            getFocusedMediaPlayerElement().MediaPlayer.MediaEnded -= MediaPlayer_MediaEnded;
            switchFocusedMediaPlayers();
            getFocusedMediaPlayerElement().MediaPlayer.MediaEnded += MediaPlayer_MediaEnded;

            if (videoState == VIDEO_STATE.LOOP)
            {
                getFocusedMediaPlayerElement().MediaPlayer.IsLoopingEnabled = true;
            }
            else
            {
                getFocusedMediaPlayerElement().MediaPlayer.IsLoopingEnabled = false;
            }

            this.videoState = videoState;
            if (videoEnded != null)
            {
                this.videoEnded = videoEnded;
            }
            else
            {
                this.videoEnded = null;
            }

            getFocusedMediaPlayerElement().Source = source;

            getFocusedMediaPlayerElement().MediaPlayer.Play();
            animateMediaPlayers();
        }
        // ReSharper disable once UnusedMember.Global -JSInvokable used by javascript code
        public async Task GetNextVideo()
        {
            await Task.Delay(500);

            await JSRuntime.RemoveYouTubePlayer();

            await VideoEnded.InvokeAsync(false);
        }
Пример #3
0
 public void NotifyVideoEnded()
 {
     VideoEnded?.Invoke(this, EventArgs.Empty);
 }
 public void OnVideoEnded()
 {
     VideoEnded?.Invoke();
 }
Пример #5
0
 internal void VideoEnd()
 {
     VideoEnded?.Invoke(this, EventArgs.Empty);
 }
Пример #6
0
 public void setOnVideoEnded(VideoEnded videoEnded)
 {
     this.videoEnded = videoEnded;
 }