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); }
public void NotifyVideoEnded() { VideoEnded?.Invoke(this, EventArgs.Empty); }
public void OnVideoEnded() { VideoEnded?.Invoke(); }
internal void VideoEnd() { VideoEnded?.Invoke(this, EventArgs.Empty); }
public void setOnVideoEnded(VideoEnded videoEnded) { this.videoEnded = videoEnded; }