Ejemplo n.º 1
0
 public override void OnTracksChanged(TrackGroupArray trackGroups, TrackSelectionArray trackSelections)
 {
     activity.UpdateButtonVisibilities();
     if (trackGroups != activity.lastSeenTrackGroupArray)
     {
         MappedTrackInfo mappedTrackInfo = activity.trackSelector.CurrentMappedTrackInfo;
         if (mappedTrackInfo != null)
         {
             if (mappedTrackInfo.GetTypeSupport(C.TrackTypeVideo)
                 == MappedTrackInfo.RendererSupportUnsupportedTracks)
             {
                 activity.ShowToast(Resource.String.error_unsupported_video);
             }
             if (mappedTrackInfo.GetTypeSupport(C.TrackTypeAudio)
                 == MappedTrackInfo.RendererSupportUnsupportedTracks)
             {
                 activity.ShowToast(Resource.String.error_unsupported_audio);
             }
         }
         activity.lastSeenTrackGroupArray = trackGroups;
     }
 }
Ejemplo n.º 2
0
        // OnClickListener methods

        public void OnClick(View view)
        {
            if (view.Parent == debugRootView)
            {
                MappedTrackInfo mappedTrackInfo = trackSelector.CurrentMappedTrackInfo;
                if (mappedTrackInfo != null)
                {
                    string title                   = ((Button)view).Text;
                    int    rendererIndex           = (int)view.GetTag(view.Id);
                    int    rendererType            = mappedTrackInfo.GetRendererType(rendererIndex);
                    bool   allowAdaptiveSelections =
                        rendererType == C.TrackTypeVideo ||
                        (rendererType == C.TrackTypeAudio &&
                         mappedTrackInfo.GetTypeSupport(C.TrackTypeVideo)
                         == MappedTrackInfo.RendererSupportNoTracks);
                    Pair dialogPair = TrackSelectionView.GetDialog(this, title, trackSelector, rendererIndex);

                    ((TrackSelectionView)dialogPair.Second).SetShowDisableOption(true);
                    ((TrackSelectionView)dialogPair.Second).SetAllowAdaptiveSelections(allowAdaptiveSelections);
                    ((AlertDialog)dialogPair.First).Show();
                }
            }
        }