-
-
Save abhiint16/165449a1a7d1a55a8f69d23718c603c2 to your computer and use it in GitHub Desktop.
getReso is just an Interface. Check line no. 50s in this - https://gist.github.com/abhiint16/b473e9b1111bd8bda4833c288ae6a1b4
So, you can implement this interface in your PlayerActivity and hence you'll get a callback method
void getResoText(String resoText);
Now, this callback method will be called with the string value (Low, Med, High etc) whenever you change your resolution in TrackSelection.
This is understand but Pair<AlertDialog, MyTrackSelection> dialogPair = MyTrackSelection
.getDialog(PlayerActivity.this, "Video Qualiry", mTrackSelector, 0,
getResoText(getResoText), mTrackSelector.toString(), mPlayer.getVideoFormat()); Pls check my sample. Let me know how to solved this
- You need to implement GetReso interface
- Then, override the provided method from GetReso interface.
then,
Pair<AlertDialog, MyTrackSelection> dialogPair = MyTrackSelection.getDialog(context, "Video Quality", mTrackSelector, 0, this, track_selection_text.getText().toString())
override the provided method from GetReso interface.
what should i write in this method?
Each video that you play has to provide resolution list to show it to your user. You need to debug in MyTackSelection's updateViews() method and see for trackGroups.length. For you, it seems that the length is 0
override the provided method from GetReso interface.
what should i write in this method?
Can you please elaborate what should i do ? Because if its normal list then its working fine,,,,
Could you please share me some sample code ?
The overridden method is used show the selected resolution to the UI.
Each video that you play has to provide resolution list to show it to your user. You need to debug in MyTackSelection's updateViews() method and see for trackGroups.length. For you, it seems that the length is 0
Track length getting 1.
You'll have to open "exo_track_selection_view" XML and then change the package name (path name)to your custom TrackSelector.java
you'll find something like below in the XML`
<X.Y.Z.TrackSelection android:id="@+id/exo_track_selection_init_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" />
`
you need to change X.Y.Z.Trackselection to com.maxtv.activity.tv.TrackSelection
So if i am doing this , i am not able to set my player
how to open exo_track_selection_dialog.xml and change to TrackSelection.
im getting this error
java.lang.ClassCastException: androidx.viewpager.widget.ViewPager cannot be cast to co.appmastery.worldbbtv.downloader.TrackSelection E/AndroidRuntime(30347): at co.appmastery.worldbbtv.downloader.TrackSelection.getDialog(TrackSelection.java:70) E/AndroidRuntime(30347): at co.appmastery.worldbbtv.PlayerActivity.test(PlayerActivity.java:909)
Any fix with the resoultion like youtube only 720 , 360 etc?
@fridapinto-debug
GetReso is just an Interface. Check line no. 50s in this - https://gist.github.com/abhiint16/b473e9b1111bd8bda4833c288ae6a1b4
So, you can implement this interface in your PlayerActivity and hence you'll get a callback method
void getResoText(String resoText);
Now, this callback method will be called with the string value (Low, Med, High etc) whenever you change your resolution in TrackSelection.