Example #1
0
        void cleanupVideoPlayback(bool sendStoppedState = true)
        {
            if (videoBufferThread != null && videoBufferThread.IsAlive)
            {
                videoBufferThread.Abort();
                videoBufferThread = null;
            }
            if (bufferingPlayer != null)
            {
                GUIWaitCursor.Hide();
                bufferingPlayer.Dispose();
                bufferingPlayer = null;
            }
            if (hlsParser != null)
            {
                GUIWaitCursor.Hide();
                hlsParser = null;
            }
            if (proxy != null)
            {
                proxy.Stop();
                proxy = null;
            }
            if (sendStoppedState && currentVideoSessionId != null)
            {
                airplayServer.SetPlaybackState(currentVideoSessionId, PlaybackCategory.Video, PlaybackState.Stopped);
            }

            restoreVolume();
            currentVideoSessionId = null;
            currentVideoPlayer    = null;
            currentVideoUrl       = null;
        }
Example #2
0
        void cleanupVideoPlayback()
        {
            if (hlsParser != null)
            {
                ServiceRegistration.Get <ISuperLayerManager>().HideBusyScreen();
                hlsParser = null;
            }
            if (proxy != null)
            {
                proxy.Stop();
                proxy = null;
            }

            restoreVolume();
            currentVideoSessionId = null;
            currentVideoUrl       = null;
        }
Example #3
0
        void hlsParser_Completed(object sender, EventArgs e)
        {
            lock (videoInfoSync)
            {
                if (sender != hlsParser)
                {
                    return;
                }

                //We shouldn't alter currentVideoUrl as this is how we check for duplicate requests
                string finalUrl;
                bool   useMPUrlSourceFilter;
                if (hlsParser.IsHls)
                {
                    useMPUrlSourceFilter = false;
                    finalUrl             = hlsParser.SelectBestSubStream(allowHDStreams);
                    //Secure HLS stream
                    if (isSecureUrl(finalUrl))
                    {
                        //Lav Splitter does not support SSL so it cannot download the HLS segments
                        //Use reverse proxy to workaround
                        Logger.Instance.Debug("Airplayer: Secure HLS Stream, setting up proxy");
                        proxy = new HlsProxy();
                        proxy.Start();
                        finalUrl = proxy.GetProxyUrl(finalUrl);
                    }
                }
                else
                {
                    finalUrl = currentVideoUrl;
                    //Again, MPUrlSource does not support SSL, FileSource is OK for non HLS streams
                    //Use MPUrlSource if we're not secure and definately not a HLS stream or we can guess filetype by extension
                    useMPUrlSourceFilter = !isSecureUrl(finalUrl) && (hlsParser.Success || isKnownExtension(finalUrl));
                }
                hlsParser = null;
                ServiceRegistration.Get <ISuperLayerManager>().HideBusyScreen();
                startVideoLoading(finalUrl, useMPUrlSourceFilter);
            }
        }