Search code examples
javaandroidhttp-live-streamingexoplayer2.x

Removing None option in PickList AdaptiveTrackSelection


How do I remove None option from Picklist, Any hint will be appreciated ! Here is my code to fetch the supported bitrate from the URL.

    MappingTrackSelector.MappedTrackInfo mappedTrackInfo = selector.getCurrentMappedTrackInfo();
    if (mappedTrackInfo != null) {
        int rendererIndex = 0;
        int rendererType = mappedTrackInfo.getRendererType(rendererIndex);
        boolean allowAdaptiveSelections =
                rendererType == C.TRACK_TYPE_VIDEO
                        || (rendererType == C.TRACK_TYPE_AUDIO
                        && mappedTrackInfo.getTypeSupport(C.TRACK_TYPE_VIDEO)
                        == MappingTrackSelector.MappedTrackInfo.RENDERER_SUPPORT_NO_TRACKS);
        Pair<AlertDialog, TrackSelectionView> dialogPair =
                TrackSelectionView.getDialog(VideoStream.this, "Available Quality", (DefaultTrackSelector) selector, rendererIndex);
        dialogPair.second.setShowDisableOption(true);
        dialogPair.second.setAllowAdaptiveSelections(allowAdaptiveSelections);
        dialogPair.first.show();
    }

**And the output ** OUTPUT Image


Solution

  • it can be done by removing the below line.

    dialogPair.second.setShowDisableOption(true);