Esempio n. 1
0
        void airplayServer_PlaybackInfoRequested(object sender, PlaybackInfoEventArgs e)
        {
            AirplayVideoPlayer currentVideoPlayer = getPlayer <AirplayVideoPlayer>();

            if (currentVideoPlayer != null)
            {
                PlaybackInfo playbackInfo = e.PlaybackInfo;
                playbackInfo.Duration = currentVideoPlayer.Duration.TotalSeconds;
                playbackInfo.Position = currentVideoPlayer.CurrentTime.TotalSeconds;
                playbackInfo.PlaybackLikelyToKeepUp = true;
                playbackInfo.ReadyToPlay            = true;
                PlaybackTimeRange timeRange = new PlaybackTimeRange();
                timeRange.Duration = playbackInfo.Duration;
                playbackInfo.LoadedTimeRanges.Add(timeRange);
                playbackInfo.SeekableTimeRanges.Add(timeRange);
                if (currentVideoPlayer.IsPaused)
                {
                    playbackInfo.Rate = 0;
                }
                else
                {
                    playbackInfo.Rate = 1;
                }
            }
        }
Esempio n. 2
0
 async void StreamProcessor_PlaybackInfoRetrieved(object sender, PlaybackInfoEventArgs e)
 {
     // DebugUtil.Log("playback info: " + MoviePlaybackData.FileName + " " + e.Packet.CurrentPosition.TotalMilliseconds);
     await SystemUtil.GetCurrentDispatcher()?.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         MoviePlaybackData.CurrentPosition = e.Packet.CurrentPosition;
         MoviePlaybackData.Duration        = e.Packet.Duration;
     });
 }
Esempio n. 3
0
 void airplay_PlaybackInfoRequested(object sender, PlaybackInfoEventArgs e)
 {
     Invoke((MethodInvoker) delegate()
     {
         if (videoForm != null)
         {
             videoForm.GetPlaybackInfo(e.PlaybackInfo);
         }
     });
 }
Esempio n. 4
0
        void airplayServer_PlaybackInfoRequested(object sender, PlaybackInfoEventArgs e)
        {
            invoke(delegate()
            {
                if (isVideoPlaying)
                {
                    PlaybackInfo playbackInfo           = e.PlaybackInfo;
                    playbackInfo.Duration               = currentVideoPlayer.Duration;
                    playbackInfo.Position               = currentVideoPlayer.CurrentPosition;
                    playbackInfo.PlaybackLikelyToKeepUp = true;
                    playbackInfo.ReadyToPlay            = true;

                    AvailableTimerange availableTimerange = currentVideoPlayer.GetAvailableTimerange();
                    PlaybackTimeRange timeRange           = new PlaybackTimeRange();
                    if (availableTimerange != null)
                    {
                        timeRange.Start    = availableTimerange.StartTime;
                        timeRange.Duration = availableTimerange.EndTime - availableTimerange.StartTime;
                    }
                    else
                    {
                        timeRange.Duration = currentVideoPlayer.Duration;
                    }
                    playbackInfo.LoadedTimeRanges.Add(timeRange);
                    playbackInfo.SeekableTimeRanges.Add(timeRange);

                    if (currentVideoPlayer.Paused)
                    {
                        playbackInfo.Rate = 0;
                    }
                    else
                    {
                        playbackInfo.Rate = 1;
                    }
                }
            });
        }