Exemple #1
0
        void airplayServer_PlaybackPositionChanged(object sender, PlaybackPositionEventArgs e)
        {
            AirplayVideoPlayer currentVideoPlayer = getPlayer <AirplayVideoPlayer>();

            if (currentVideoPlayer != null)
            {
                if (e.Position >= 0 && e.Position <= currentVideoPlayer.Duration.TotalSeconds)
                {
                    currentVideoPlayer.CurrentTime = TimeSpan.FromSeconds(e.Position);
                }
            }
            else
            {
                lock (videoInfoSync)
                {
                    if (currentVideoUrl == null && e.SessionId == lastVideoSessionId && lastVideoUrl != null)
                    {
                        airplayServer.SetPlaybackState(currentVideoSessionId, PlaybackCategory.Video, ShairportSharp.Airplay.PlaybackState.Loading);
                        currentVideoSessionId = lastVideoSessionId;
                        currentVideoUrl       = lastVideoUrl;
                        startVideoLoading(currentVideoUrl, lastUseMPUrlSourceFilter);
                    }
                }
            }
        }
        public void SetPosition(PlaybackPositionEventArgs e)
        {
            long position = (long)e.Position * COMHelper.UNITS;

            if (position <= m_Playback.Duration)
            {
                m_Playback.Position = position;
            }
        }
Exemple #3
0
 void airplay_PlaybackPositionChanged(object sender, PlaybackPositionEventArgs e)
 {
     Invoke((MethodInvoker) delegate()
     {
         if (videoForm != null)
         {
             videoForm.SetPosition(e);
         }
     });
 }
 void airplayServer_PlaybackPositionChanged(object sender, PlaybackPositionEventArgs e)
 {
     invoke(delegate()
     {
         if (isVideoPlaying)
         {
             if (e.Position >= 0 && e.Position <= currentVideoPlayer.Duration)
             {
                 currentVideoPlayer.SeekAbsolute(e.Position);
             }
         }
         else if (currentVideoUrl == null && e.SessionId == lastVideoSessionId && lastVideoUrl != null)
         {
             airplayServer.SetPlaybackState(lastVideoSessionId, PlaybackCategory.Video, PlaybackState.Loading);
             currentVideoSessionId = lastVideoSessionId;
             currentVideoUrl       = lastVideoUrl;
             startVideoLoading(currentVideoUrl, lastUseMPUrlSourceFilter);
         }
     }, false);
 }