private void ManifestInfo_SelectStreamsCompleted(object sender, StreamUpdatedListEventArgs e)
        {
            var request = e.UserState as IStreamSelectionRequest;

            if (request != null)
            {
                NotifyRequestSuccessful(request as RetryQueueRequest);
                StreamSelectionCompleted(this, request.Segment, request.Streams, e);
            }
        }
Exemplo n.º 2
0
        private void ManifestInfo_SelectStreamsCompleted(object sender, StreamUpdatedListEventArgs e)
        {
            var request = e.UserState as IStreamSelectionRequest;

            if (request != null)
            {
                NotifyRequestSuccessful(request as RetryQueueRequest);
                StreamSelectionCompleted(this, request.Segment, request.Streams, e);
            }
        }
 private void ManifestInfo_SelectStreamsCompleted(object sender, StreamUpdatedListEventArgs e)
 {
     this.element.ManifestInfo.SelectStreamsCompleted -= ManifestInfo_SelectStreamsCompleted;
     this.element.FlushBuffers(new TimeSpan(0), true, true);
     if (CurrentAudioStreamChanged != null)
     {
         CurrentAudioStreamChanged(sender, e);
     }
 }
Exemplo n.º 4
0
        private void StreamSelectionManager_StreamSelectionCompleted(StreamSelectionManager streamSelectionManager, SegmentInfo segment, IEnumerable <StreamInfo> streams, StreamUpdatedListEventArgs e)
        {
            if (e.Error == null)
            {
                foreach (StreamUpdatedEventArgs update in e.StreamUpdatedEvents)
                {
                    if (update.Action == StreamUpdatedEventArgs.StreamUpdatedAction.StreamSelected)
                    {
                        var stream = update.Stream;
#if !WINDOWS_PHONE
                        if ((stream.GetStreamType().ToLower() == "binary" || stream.GetStreamType().ToLower() == "text") && stream.AvailableTracks.Any())
                        {
                            var track = stream.AvailableTracks.First();
                            DownloadStreamData(track);
                        }
#endif
                        if (StreamSelected != null)
                        {
                            StreamSelected(this, stream);
                        }
                    }
                    else if (update.Action == StreamUpdatedEventArgs.StreamUpdatedAction.StreamDeselected)
                    {
                        var stream = update.Stream;
#if !WINDOWS_PHONE
                        if ((stream.GetStreamType().ToLower() == "binary" || stream.GetStreamType().ToLower() == "text") && stream.AvailableTracks.Any())
                        {
                            var track = stream.AvailableTracks.First();
                            CancelDownloadStreamData(track);
                        }
#endif
                        if (StreamUnselected != null)
                        {
                            StreamUnselected(this, update.Stream);
                        }
                    }
                }
            }
            else
            {
                if (StreamSelectionFailed != null)
                {
                    StreamSelectionFailed(this, streams, e.Error);
                }
            }
        }
 private void media_CurrentAudioStreamChanged(object sender, StreamUpdatedListEventArgs e)
 {
     if (playAfterDefaultAudioChange)
     {
         //If autoplay was set and we had to set default language on start then
         //continue play now and set the flag to false
         this.playAfterDefaultAudioChange = false;
         SmoothStream_media.Play();
     }
     SendEvent("audioTrackSelected", "{\"index\":" + (media as SmoothStreamingElement).getCurrentAudioIndex() + "}");
 }
        private void StreamSelectionManager_StreamSelectionCompleted(StreamSelectionManager streamSelectionManager, SegmentInfo segment, IEnumerable<StreamInfo> streams, StreamUpdatedListEventArgs e)
        {
            if (e.Error == null)
            {
                foreach (StreamUpdatedEventArgs update in e.StreamUpdatedEvents)
                {
                    if (update.Action == StreamUpdatedEventArgs.StreamUpdatedAction.StreamSelected)
                    {
                        var stream = update.Stream;
#if !WINDOWS_PHONE
                        if ((stream.GetStreamType().ToLower() == "binary" || stream.GetStreamType().ToLower() == "text") && stream.AvailableTracks.Any())
                        {
                            var track = stream.AvailableTracks.First();
                            DownloadStreamData(track);
                        }
#endif
                        if (StreamSelected != null) StreamSelected(this, stream);
                    }
                    else if (update.Action == StreamUpdatedEventArgs.StreamUpdatedAction.StreamDeselected)
                    {
                        var stream = update.Stream;
#if !WINDOWS_PHONE
                        if ((stream.GetStreamType().ToLower() == "binary" || stream.GetStreamType().ToLower() == "text") && stream.AvailableTracks.Any())
                        {
                            var track = stream.AvailableTracks.First();
                            CancelDownloadStreamData(track);
                        }
#endif
                        if (StreamUnselected != null) StreamUnselected(this, update.Stream);
                    }
                }
            }
            else
            {
                if (StreamSelectionFailed != null) StreamSelectionFailed(this, streams, e.Error);
            }
        }
 private void StreamSelectionManager_StreamSelectionCompleted(StreamSelectionManager streamSelectionManager, Segment segment, IEnumerable<MediaStream> streams, StreamUpdatedListEventArgs e)
 {
     if (e.Error == null)
     {
         foreach (StreamUpdatedEventArgs update in e.StreamUpdatedEvents)
         {
             if (update.Action == StreamUpdatedEventArgs.StreamUpdatedAction.StreamSelected)
             {
                 StreamSelected.IfNotNull(i => i(this, new MediaStream(update.Stream)));
             }
             else if (update.Action == StreamUpdatedEventArgs.StreamUpdatedAction.StreamDeselected)
             {
                 StreamUnselected.IfNotNull(i => i(this, new MediaStream(update.Stream)));
             }
         }
     }
     else
     {
         StreamSelectionFailed.IfNotNull(i => i(this, streams.Cast<IMediaStream>(), e.Error));
     }
 }