Class AudioTrackSelectionDialogFragment

    • Constructor Detail

      • AudioTrackSelectionDialogFragment

        public AudioTrackSelectionDialogFragment()
    • Method Detail

      • newInstance

        public static AudioTrackSelectionDialogFragment newInstance​(IPlayerView playerView,
                                                                    String title)
        Creates a new dialog fragment that shows the available audio tracks and allows selecting the new track.

        By default, this dialog will not allow to disable the audio track.

        The default string representation of the audio track is its label (see AudioTrack.getLabel()).

        Parameters:
        playerView - The player view
        title - The dialog title
        Returns:
        The dialog fragment
      • newInstance

        public static AudioTrackSelectionDialogFragment newInstance​(IPlayerView playerView,
                                                                    String title,
                                                                    boolean allowDisable)
        Creates a new dialog fragment that shows the available audio tracks and allows selecting the new track.

        The default string representation of the audio track is its label (see AudioTrack.getLabel()).

        Parameters:
        playerView - The player view
        title - The dialog title
        allowDisable - If true, the dialog will allow to disable the audio track. If you need to specify a custom label for the "disable" entry, use newInstance(IPlayerView, String, boolean, Converter) and specify a custom converter
        Returns:
        The dialog fragment
      • newInstance

        public static AudioTrackSelectionDialogFragment newInstance​(IPlayerView playerView,
                                                                    String title,
                                                                    boolean allowDisable,
                                                                    Converter<AudioTrack,​String> converter)
        Creates a new dialog fragment that shows the available audio tracks and allows selecting the new track.
        Parameters:
        playerView - The player view
        title - The dialog title
        allowDisable - If true, the dialog will allow to disable the audio track.
        converter - The converter that is used to translate AudioTrack instanced to Strings that are used as labels in the dialog. Note that the converter should translate null to the string representation of the "disable" item if allowDisable is set to true.
        Returns:
        The dialog fragment
      • newInstance

        public static AudioTrackSelectionDialogFragment newInstance​(IPlayerView playerView,
                                                                    String title,
                                                                    boolean allowDisable,
                                                                    boolean showSupportedTracks,
                                                                    Converter<AudioTrack,​String> converter)
                                                             throws com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException
        Creates a new dialog fragment that shows the supported audio tracks on the device and allows selecting the new track.
        Parameters:
        playerView - The player view
        title - The dialog title
        allowDisable - If true, the dialog will allow to disable the audio track.
        converter - The converter that is used to translate AudioTrack instanced to Strings that are used as labels in the dialog. Note that the converter should translate null to the string representation of the "disable" item if allowDisable is set to true.
        showSupportedTracks - It queries decoder to show just the tracks that are supported on either the device itself or passthrough.
        Returns:
        The dialog fragment
        Throws:
        com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException - in case an error occurs when decoder information is queried