-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exoplayer v2.18.1 and some updates - fixes #114
Conversation
@PhantomPainX Are subtitles available for standard use (without ChromeCast) ? |
@PhantomPainX Do you want me to merge this PR or i wait till you fix the subtitle issue |
Hey, sorry for the late.
Yep, subtitles are available without chromecast. It should work as before.
You can merge it now, I don't think I'll fix it any time soon. |
@PhantomPainX Can you explain me why the BackPressed method in FullscreenExoPlayerFragment.java has changed
private void backPressed() {
if (
!isInPictureInPictureMode &&
Build.VERSION.SDK_INT >= Build.VERSION_CODES.N &&
packageManager.hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE) &&
isPIPModeeEnabled
) {
pictureInPictureMode();
} else {
playerExit();
}
}
private void backPressed() {
playerExit();
} Need your answer before publishing the new release as there is another PR which is now conflicting. |
@PhantomPainX I also put back some of the required files that you remove to ba able to build the plugin in Android |
It was a personal need. I required that when pressing the back button would only exit the player and not enter in pip mode if it was enabled, I forgot to leave the original function. However I think this is the correct action when you press the back button. Anyway it's up to you if you want to leave the original function. If you keep the original, then you need to check if the player is in Chromecast mode and just exit the player in that case |
@PhantomPainX thanks for answering i will put back the funcion. Is tjere à variable to test if we are in Chromecast mode? |
No I didn't set any as far as i remember, you can use a global variable and toggle it in castPlayer.setSessionAvailabilityListener, or use: if (chromecast) {
if (castContext.getCastState() == CastState.CONNECTED) {
...
}
} If you use and set a variable in castPlayer.setSessionAvailabilityListener: onCastSessionAvailable() means the cast started |
@PhantomPainX can you test this
It would also be nice when you do a modification to run the angular-videoplayer-app-starter it seems that some video type are not working anymore DASH MPD.
Can you have a look? |
@PhantomPainX I got the same type of error when the video reach the end |
@PhantomPainX The Dash mpd video is working. it was the url which were not existing anymore |
@PhantomPainX the error seerms to come from exoplayer itself i try ExoPlayerDemo which is giving the same error when doing a back press |
I will test your code and about the dash problem, I will check this and maybe get a fix in some way. Anyway that demo you used has the latest version of exoplayer, so if it's a bug in their side, maybe the best solution is to downgrade and try. It worked before? |
Updated dependencies
Design and UI fixes
Previously the player used a totally custom UI design. When I updated to exoplayer v2.18.1 I decided to use the default one with some additions: chromecast, pip and resize buttons, titles and back button.
The default design comes with some automatic options like subtitle button, speed and audio selection:
Chromecast mode
Previously when using this mode, the player would only show the controls (not stay on screen) with a black background and a message alerting about the cast. This was improved adding an optional param to the initialization called "artwork", this image will be shown in the player, media notification panel and lock screen when casting.
- The artwork must be a remote URL
Chromecast issues
The MediaRouteButton (cast button)
It will hide when you enter in PIP or BK mode. The button won't show up unless you restart the app. This only happens in Android 13 (some users of my app reported me this issue and I confirmed it with an OnePlus 8T)
As this cast thing can only be tested with real devices, I was only able to test it in my other phone (Samsung Galaxy S9+) with Android 10 and this error didn't happen, so I don't know if this happens in Android 11 and 12.
The error is related with addCastStateListener. It fires state 1 (NO_DEVICES_AVAILABLE) when entering in PIP mode or BKMode and never updates the state again.
Subtitles are not available yet
I tried so hard to get the subtitles working when casting a video but it simple didn't work, sorry for that.
Why not v2.18.2
It needs a compileSdkVersion of at least 33