Пример #1
0
        void airplayServer_VideoReceived(object sender, VideoEventArgs e)
        {
            airplayServer.SetPlaybackState(e.SessionId, PlaybackCategory.Video, PlaybackState.Loading);
            invoke(delegate()
            {
                //YouTube sometimes sends play video twice?? Ignore the second request
                if (e.SessionId == currentVideoSessionId && e.ContentLocation == currentVideoUrl)
                {
                    Logger.Instance.Debug("Airplayer: Ignoring duplicate playback request");
                    return;
                }

                videoReceiveTime = DateTime.Now;
                stopCurrentItem();
                cleanupPlayback();

                GUIGraphicsContext.ResetLastActivity();
                GUIWaitCursor.Init(); GUIWaitCursor.Show();

                currentVideoSessionId = e.SessionId;
                currentVideoUrl       = e.ContentLocation;
                //See if we are loading a HLS stream.
                //If so, manually select the best quality as LAVSplitter just selects the first/default.
                //If not, allow MPUrlSourceFilter as it has better seeking support but doesn't seem to like HLS streams :(
                hlsParser            = new HlsParser(currentVideoUrl);
                hlsParser.Completed += hlsParser_Completed;
                hlsParser.Start();
            });
        }
Пример #2
0
        void airplayServer_VideoReceived(object sender, VideoEventArgs e)
        {
            airplayServer.SetPlaybackState(e.SessionId, PlaybackCategory.Video, ShairportSharp.Airplay.PlaybackState.Loading);
            lock (videoInfoSync)
            {
                //YouTube sometimes sends play video twice?? Ignore second
                if (e.SessionId == currentVideoSessionId && e.ContentLocation == currentVideoUrl)
                {
                    Logger.Instance.Debug("Airplayer: Ignoring duplicate playback request");
                    return;
                }

                videoReceiveTime = DateTime.Now;
                stopPlayer <AirplayVideoPlayer>();
                cleanupVideoPlayback();
                ServiceRegistration.Get <ISuperLayerManager>().ShowBusyScreen();

                currentVideoSessionId = e.SessionId;
                currentVideoUrl       = e.ContentLocation;
                //See if we are loading a HLS stream.
                //If so, manually select the best quality as LAVSplitter just selects the first/default.
                //If not, allow allow MPUrlSourceFilter as it has better seeking support but doesn't seem to like HLS streams :(
                hlsParser            = new HlsParser(currentVideoUrl);
                hlsParser.Completed += hlsParser_Completed;
                hlsParser.Start();
            }
        }