-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[WIP] New embeded in fragment video player #834
Conversation
Good job, I've briefly went over the changes and tested it, and as you've said, it does feel pretty smooth. However, here are some major things I saw:
Sorry for this quick review, I will do a more thorough review again soon. In the mean time, keep up the good work. I should be able to answer questions regarding the players and play queue if you need any help. |
@karyogamy |
4: this button shouldn't exist. If a user will press on it new autorotation mechanism will not work as expected. Author of the issue #714 wants video rotated only when video recorded in landscape mode. So if he wants to see the video in the landscape orientation he will rotate a device, right? Then new autorotation will rotate screen too as the user wants. What's wrong? |
@avently a famous german computer magazing wrote they liked NewPipe especially the rotation button was something they mentioned. Now calculate the chances I'm going to let that button be killed :P |
@theScrabi: I like that button too. Btw you're talking about c't, right? It
wasn't in the Dutch version though.
|
Yes the c't. Didn't know that there is a dutch version of it. |
You can take a look into PopupVideoPlayer, which is a service binding (PlayerServiceBinder) with PopupVideoPlayerActivity(extending ServicePlayerActivity). This is how popup and background players interact with their respective UI. You can then start a player service in the details fragment and create a different binder which allows you to pass the video view to the player in the service. For example, once the player view is changed (e.g. turn to full screen), you can call the service to changed the video surface like this |
I done this pull request. Everything I and karyogamy and theScrabi wanted is working. So you can merge it and use as a base of the next commits. |
@theScrabi what's your thoughts about this PR? Do you plan to review it? Maybe the code looks bad or something else |
There are to much conflicts atm could you please resolve them. |
- replaced video player from activity to fragment. Now you don't need to open another activity to watch a video. All elements are in one fragment. With fullscreen support. - hid some interface elements from the old player implementation (will remove all useless methods and elements later) - added search icon to video fragment, subscription page and a user page - now app will use the autoPlay option from settings in video player's fragment - added initial implementation of longClick action to all infolistitems - resolution selection was reworked - hid prev and next buttons when they shouldn't work - replaced rotation button with autorotation mechanism while you are watching a video
- titleview and channelview visible now - show queueButton only when playQueue.getStreams().size() > 1 - autorotation can be selected in settings (with russian translation). By default autorotation is disabled and a button to rotateOrientation is visible. - code folows Java variable naming convention
Now you can see where you choosed playlist or not. NextVideoButton and queue button at the top right corner will help you to see it.
- MainVideoPlayer now based on background Service. Communication works via binder and intents. Notification added every "onPlaying" event and removed after "OnPause". Tried to avoid using the notification. - notification image cached. - after screen turned off music keeps playing (not video). - custom brightness value saved and applied while you are watching videos. - rewrote and simplified my code. - video keeps playing while being in a orientation rotation process
- fixed possible crash(es) and allowed to restart playing after error - better error handling - added if(DEBUG) for logs - changed methods visibility to private - set notification priority to MIN
It's too colored for fullscreen mode so i hid it.
- added swipe gesture recognizer for changing current video position
- commits based on dev branch - readded fullscreenButton to PopupPlayer that was removed in one of a previous commits
8122723
to
dfcfb60
Compare
@theScrabi done. Also I readded fullscreenButton to popup because without it we can't close popup window. |
@theScrabi could this be merged? My new PR will be based on this code. |
All right. I'm sorry for that long delay. I finally tested this now. Fullscreen and rotation
Stop the video when NewPipe is offscreen
Remove search Icon
Switching back from Background player
|
- exit fullscreen mode when video is ended - enter fullscreen mode when device in landscape orientation
- only an audio are working while user went away from the app
- popup and background players now start playing from currentPosition even in "append" mode - when user closes popup playback continues in the main player - fixed videoRenderer issue caused by destroyed fragment - adapted autoplay in Playlist & Channel fragments
@theScrabi, please, review. |
It would be nice if full screen is disabled again if switching back to portrait mode.
I see that you are switching to a player with your own notificatoin inteface. Please use the original background player instead.
Well you removed the rotation button again. I ment that the rotation button should remain, and that the video starts in fullscreen when in landscape and non fullscreen when in portrait. The way of changing the rotation should not be altered. |
@theScrabi tell something about the last commit related to screen rotation. Is it what you are asking about? |
Anyway with the last commit i made performance much better. Video in main player and in popup opens so fast. When phone is in screen rotating process views redrawing faster. So, maybe performance issues, you, @mauriciocolli, mentioned is fixed. |
- in main player resize mode ZOOM can make video frame larger than screen. Added methods to prevent it
@karyogamy I added you method but it is unused because I can't check how it works on old Android versions with new player interface. Maybe without it will be ok. Or not. Some parts of your commits were not copied to this code (code for old player's activity lifecycle, for example). So be aware |
I'm done with this PR since now. I will not add any single line of code to that feature until the PR will be merged. So now it is your problem to implement embed in fragment player. You may use my code or you can make your personal implementation for that feature, I do not really care about that. You can even close this PR. Happy codding! |
@avently Sorry for the late reply. As stated from my previous comment, I have started working on a separate player library to, hopefully, integrate with newpipe in the future. This is being done because our player is steadily becoming more complex and less modular with respect to the app. And without any unit test, which is mainly my fault, refactoring and code changes to the player (or the app itself) is almost always going to introduce bugs, not mentioning the additional work needed for reviewing (and manual testing is simply not enough at this point). So this library aims to address these problems with the player, while also provide some support extensions for exoplayer in other apps. I can't give a strict deadline on when this will be done, though the initial commit will probably come this weekend or the next. We'll be glad if you are around to help with embedding the new player to the detail fragments (which won't be part of the library), as you are knowledgeable with their subtleties. But if not, I completely understand and wish you all the best. |
So when will this be implemented in the app? |
Its apparently on ice, waiting for merging, sadly |
As @karyogamy points out, and as we said multiple times in this thread. It wasn't a good time to introduce this changes. They deeply impact NewPipe, which makes it complicated. I promis this player will come, but please stay patient. So that in the end you don't get it with a good, but best quality 😉 |
Here is a translation of the previous comment: So, that's reality I see in NewPipe world. This app is alive, thanks for it's contributors. But I think it is important to make decisions that do not limit app success. Because now with your decisions app will die in a moment when karyogamy will lose his interest or time that he can give for PRs. I don't want it. @theScrabi I don't want to read your answer. I just wanted to say all this. If you are responsible for the app now create something your users ask for such long period. Or you are not the guy who created the great app. Maybe you are not ready for changes. |
And for the record, you are not allowed to reopen this PR. Create your own. This will be the history of my fail. |
I am quite open for contributions, but sometimes some decisions have to be made. NewPipe is quite a big project, and its quite hard to maintain. I sometimes have to decide which contribution is good to be added and which is not in order to maintain a good quality. The bigger a project becomes the more important it gets to keep track of the quality. Our contribution node clearly states one who wants to contribute has to be patient when we denial something because of changes, and sometimes one has to accept if we just say no. |
What was done in this PR: