jhomlala / betterplayer

Better video player for Flutter, with multiple configuration options. Solving typical use cases!
Apache License 2.0
919 stars 981 forks source link

Audio Tacks Return Null and Also Selected return null values [BUG] #1124

Open xTanveerAhmad opened 1 year ago

xTanveerAhmad commented 1 year ago

final List? tracks = betterPlayerController.betterPlayerAsmsAudioTracks; final BetterPlayerAsmsAudioTrack? selectedTrack = betterPlayerController.betterPlayerAsmsAudioTrack; print(selectedTrack.toString());

I also Enable enableAudioTracks: true,

rounce commented 1 year ago

Without a link to the source of the video (dash or hls) nothing can be said.

xTanveerAhmad commented 1 year ago

i am playing local video.

xTanveerAhmad commented 1 year ago

and i want to get all audio tracks but its returning null.

rounce commented 1 year ago

The Better Player can get a list of audio tracks only for dash and hls. There is no such functionality for video files. BetterPlayerAsmsAudioTrack: Representation of HLS / DASH audio tracks (c) documentation.

xTanveerAhmad commented 1 year ago

I have a multi language local video file than how can i get list of audios.

rounce commented 1 year ago

On android Better Player uses ExoPlayer. Exoplayer can get a list of audio tracks and you can write Kotlin code that will pass this list to dart.

xTanveerAhmad commented 1 year ago

Rounce do you have any code than please send me its urgent.

rafaelrabaco commented 1 year ago

I have the same problem, but i'm using dash source The player does not recognize any audio or subtitles

rounce commented 1 year ago

I have the same problem, but i'm using dash source

Try https://github.com/jhomlala/betterplayer/pull/872

rafaelrabaco commented 1 year ago

I have the same problem, but i'm using dash source

Try #872

The mimeType already exists in the adaptationSet

Captura de Tela 2022-12-19 às 11 10 57

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<MPD profiles="urn:mpeg:dash:profile:isoff-live:2011" type="dynamic" availabilityStartTime="2011-03-01T00:00:05Z" minimumUpdatePeriod="PT2.0S" minBufferTime="PT2.0S" publishTime="2022-12-19T14:05:48.631Z" timeShiftBufferDepth="PT5M" suggestedPresentationDelay="PT4.0S" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd">
  <Period start="PT0S" id="1">
    <AdaptationSet mimeType="video/mp4" startWithSAP="1" segmentAlignment="true" par="16:9">
      <SegmentTemplate timescale="10000000" presentationTimeOffset="0" media="video/$Bandwidth$/Segment-$Time$.m4s">
        <SegmentTimeline>
          <S t="3725208483223103" d="20020000" r="149"/>
        </SegmentTimeline>
      </SegmentTemplate>
      <Representation width="256" height="144" frameRate="30000/1001" codecs="avc1.42800d" scanType="progressive" sar="1:1" id="stream_01" bandwidth="250000"/>
      <Representation width="320" height="180" frameRate="30000/1001" codecs="avc1.4d400d" scanType="progressive" sar="1:1" id="stream_02" bandwidth="400000"/>
      <Representation width="512" height="288" frameRate="30000/1001" codecs="avc1.4d401e" scanType="progressive" sar="1:1" id="stream_03" bandwidth="800000"/>
      <Representation width="640" height="360" frameRate="30000/1001" codecs="avc1.4d401e" scanType="progressive" sar="1:1" id="stream_04" bandwidth="1300000"/>
      <Representation width="768" height="432" frameRate="30000/1001" codecs="avc1.4d401e" scanType="progressive" sar="1:1" id="stream_05" bandwidth="2400000"/>
      <Representation width="1280" height="720" frameRate="30000/1001" codecs="avc1.64001f" scanType="progressive" sar="1:1" id="stream_06" bandwidth="3700000"/>
    </AdaptationSet>
    <AdaptationSet mimeType="audio/mp4" startWithSAP="1" lang="en" segmentAlignment="true">
      <SegmentTemplate timescale="10000000" presentationTimeOffset="0" media="audio/en/Segment-$Time$.m4s">
        <SegmentTimeline>
          <S t="3725208483256436" d="20053333"/>
          <S t="3725208503309770" d="20053333" r="2"/>
          <S t="3725208563469770" d="20053333"/>
          <S t="3725208583523103" d="19840000"/>
          <S t="3725208603363103" d="20053333" r="1"/>
          <S t="3725208643469770" d="20053333" r="2"/>
          <S t="3725208703629770" d="19840000"/>
          <S t="3725208723469770" d="20053333" r="2"/>
          <S t="3725208783629770" d="20053333" r="2"/>
          <S t="3725208843789770" d="19840000"/>
          <S t="3725208863629770" d="20053333" r="2"/>
          <S t="3725208923789770" d="20053333" r="1"/>
          <S t="3725208963896436" d="19840000"/>
          <S t="3725208983736436" d="20053333"/>
          <S t="3725209003789770" d="20053333" r="2"/>
          <S t="3725209063949770" d="20053333"/>
          <S t="3725209084003103" d="19840000"/>
          <S t="3725209103843103" d="20053333" r="1"/>
          <S t="3725209143949770" d="20053333" r="2"/>
          <S t="3725209204109770" d="20053333"/>
          <S t="3725209224163103" d="19840000"/>
          <S t="3725209244003103" d="20053333" r="1"/>
          <S t="3725209284109770" d="20053333" r="2"/>
          <S t="3725209344269770" d="19840000"/>
          <S t="3725209364109770" d="20053333" r="2"/>
          <S t="3725209424269770" d="20053333" r="2"/>
          <S t="3725209484429770" d="19840000"/>
          <S t="3725209504269770" d="20053333" r="2"/>
          <S t="3725209564429770" d="20053333" r="1"/>
          <S t="3725209604536436" d="19840000"/>
          <S t="3725209624376436" d="20053333"/>
          <S t="3725209644429770" d="20053333" r="2"/>
          <S t="3725209704589770" d="20053333"/>
          <S t="3725209724643103" d="19840000"/>
          <S t="3725209744483103" d="20053333" r="1"/>
          <S t="3725209784589770" d="20053333" r="2"/>
          <S t="3725209844749770" d="20053333"/>
          <S t="3725209864803103" d="19840000"/>
          <S t="3725209884643103" d="20053333" r="1"/>
          <S t="3725209924749770" d="20053333" r="2"/>
          <S t="3725209984909770" d="19840000"/>
          <S t="3725210004749770" d="20053333" r="2"/>
          <S t="3725210064909770" d="20053333" r="2"/>
          <S t="3725210125069770" d="19840000"/>
          <S t="3725210144909770" d="20053333" r="2"/>
          <S t="3725210205069770" d="20053333" r="1"/>
          <S t="3725210245176436" d="19840000"/>
          <S t="3725210265016436" d="20053333"/>
          <S t="3725210285069770" d="20053333" r="2"/>
          <S t="3725210345229770" d="20053333"/>
          <S t="3725210365283103" d="19840000"/>
          <S t="3725210385123103" d="20053333" r="1"/>
          <S t="3725210425229770" d="20053333" r="2"/>
          <S t="3725210485389770" d="20053333"/>
          <S t="3725210505443103" d="19840000"/>
          <S t="3725210525283103" d="20053333" r="1"/>
          <S t="3725210565389770" d="20053333" r="2"/>
          <S t="3725210625549770" d="19840000"/>
          <S t="3725210645389770" d="20053333" r="2"/>
          <S t="3725210705549770" d="20053333" r="2"/>
          <S t="3725210765709770" d="19840000"/>
          <S t="3725210785549770" d="20053333" r="2"/>
          <S t="3725210845709770" d="20053333" r="1"/>
          <S t="3725210885816436" d="19840000"/>
          <S t="3725210905656436" d="20053333"/>
          <S t="3725210925709770" d="20053333" r="2"/>
          <S t="3725210985869770" d="20053333"/>
          <S t="3725211005923103" d="19840000"/>
          <S t="3725211025763103" d="20053333" r="1"/>
          <S t="3725211065869770" d="20053333" r="2"/>
          <S t="3725211126029770" d="20053333"/>
          <S t="3725211146083103" d="19840000"/>
          <S t="3725211165923103" d="20053333" r="1"/>
          <S t="3725211206029770" d="20053333" r="2"/>
          <S t="3725211266189770" d="19840000"/>
          <S t="3725211286029770" d="20053333" r="2"/>
          <S t="3725211346189770" d="20053333" r="2"/>
          <S t="3725211406349770" d="19840000"/>
          <S t="3725211426189770" d="20053333" r="2"/>
        </SegmentTimeline>
      </SegmentTemplate>
      <Representation audioSamplingRate="48000" codecs="mp4a.40.2" id="stream_08" bandwidth="96000"/>
    </AdaptationSet>
    <AdaptationSet mimeType="audio/mp4" startWithSAP="1" lang="pt" segmentAlignment="true">
      <SegmentTemplate timescale="10000000" presentationTimeOffset="0" media="audio/pt/Segment-$Time$.m4s">
        <SegmentTimeline>
          <S t="3725208483256436" d="20053333"/>
          <S t="3725208503309770" d="20053333" r="2"/>
          <S t="3725208563469770" d="20053333"/>
          <S t="3725208583523103" d="19840000"/>
          <S t="3725208603363103" d="20053333" r="1"/>
          <S t="3725208643469770" d="20053333" r="2"/>
          <S t="3725208703629770" d="19840000"/>
          <S t="3725208723469770" d="20053333" r="2"/>
          <S t="3725208783629770" d="20053333" r="2"/>
          <S t="3725208843789770" d="19840000"/>
          <S t="3725208863629770" d="20053333" r="2"/>
          <S t="3725208923789770" d="20053333" r="1"/>
          <S t="3725208963896436" d="19840000"/>
          <S t="3725208983736436" d="20053333"/>
          <S t="3725209003789770" d="20053333" r="2"/>
          <S t="3725209063949770" d="20053333"/>
          <S t="3725209084003103" d="19840000"/>
          <S t="3725209103843103" d="20053333" r="1"/>
          <S t="3725209143949770" d="20053333" r="2"/>
          <S t="3725209204109770" d="20053333"/>
          <S t="3725209224163103" d="19840000"/>
          <S t="3725209244003103" d="20053333" r="1"/>
          <S t="3725209284109770" d="20053333" r="2"/>
          <S t="3725209344269770" d="19840000"/>
          <S t="3725209364109770" d="20053333" r="2"/>
          <S t="3725209424269770" d="20053333" r="2"/>
          <S t="3725209484429770" d="19840000"/>
          <S t="3725209504269770" d="20053333" r="2"/>
          <S t="3725209564429770" d="20053333" r="1"/>
          <S t="3725209604536436" d="19840000"/>
          <S t="3725209624376436" d="20053333"/>
          <S t="3725209644429770" d="20053333" r="2"/>
          <S t="3725209704589770" d="20053333"/>
          <S t="3725209724643103" d="19840000"/>
          <S t="3725209744483103" d="20053333" r="1"/>
          <S t="3725209784589770" d="20053333" r="2"/>
          <S t="3725209844749770" d="20053333"/>
          <S t="3725209864803103" d="19840000"/>
          <S t="3725209884643103" d="20053333" r="1"/>
          <S t="3725209924749770" d="20053333" r="2"/>
          <S t="3725209984909770" d="19840000"/>
          <S t="3725210004749770" d="20053333" r="2"/>
          <S t="3725210064909770" d="20053333" r="2"/>
          <S t="3725210125069770" d="19840000"/>
          <S t="3725210144909770" d="20053333" r="2"/>
          <S t="3725210205069770" d="20053333" r="1"/>
          <S t="3725210245176436" d="19840000"/>
          <S t="3725210265016436" d="20053333"/>
          <S t="3725210285069770" d="20053333" r="2"/>
          <S t="3725210345229770" d="20053333"/>
          <S t="3725210365283103" d="19840000"/>
          <S t="3725210385123103" d="20053333" r="1"/>
          <S t="3725210425229770" d="20053333" r="2"/>
          <S t="3725210485389770" d="20053333"/>
          <S t="3725210505443103" d="19840000"/>
          <S t="3725210525283103" d="20053333" r="1"/>
          <S t="3725210565389770" d="20053333" r="2"/>
          <S t="3725210625549770" d="19840000"/>
          <S t="3725210645389770" d="20053333" r="2"/>
          <S t="3725210705549770" d="20053333" r="2"/>
          <S t="3725210765709770" d="19840000"/>
          <S t="3725210785549770" d="20053333" r="2"/>
          <S t="3725210845709770" d="20053333" r="1"/>
          <S t="3725210885816436" d="19840000"/>
          <S t="3725210905656436" d="20053333"/>
          <S t="3725210925709770" d="20053333" r="2"/>
          <S t="3725210985869770" d="20053333"/>
          <S t="3725211005923103" d="19840000"/>
          <S t="3725211025763103" d="20053333" r="1"/>
          <S t="3725211065869770" d="20053333" r="2"/>
          <S t="3725211126029770" d="20053333"/>
          <S t="3725211146083103" d="19840000"/>
          <S t="3725211165923103" d="20053333" r="1"/>
          <S t="3725211206029770" d="20053333" r="2"/>
          <S t="3725211266189770" d="19840000"/>
          <S t="3725211286029770" d="20053333" r="2"/>
          <S t="3725211346189770" d="20053333" r="2"/>
          <S t="3725211406349770" d="19840000"/>
          <S t="3725211426189770" d="20053333" r="2"/>
        </SegmentTimeline>
      </SegmentTemplate>
      <Representation audioSamplingRate="48000" codecs="mp4a.40.2" id="stream_07" bandwidth="96000"/>
    </AdaptationSet>
  </Period>
</MPD>