Skip to content
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

Playback state callback #257

Closed
1 task done
miladz68 opened this issue Jun 25, 2016 · 4 comments · Fixed by #758
Closed
1 task done

Playback state callback #257

miladz68 opened this issue Jun 25, 2016 · 4 comments · Fixed by #758
Assignees
Milestone

Comments

@miladz68
Copy link

miladz68 commented Jun 25, 2016

  • I have verified there are no duplicate active or recent bugs, questions, or requests
Include the following:
  • ExoMedia version: 3.0.0
  • Device OS version: 6.0
  • Devide Manufacturer: LG
  • Device Name: Nexus 5x

I used to get the the playback state in version 2.5.6 through the ExoPlayer listener. In the newer version 3.0.0 the addExoPlayerListener method is removed and I cannot access the playback state. the new PlayList core that you have added also doesn't work as it is supposed to be. when the playback is paused when the player is buffering, onPlaybackStateChanged is not called.

what is the best way to access in playback state at the moment.

@brianwernick brianwernick changed the title access playback state in new exomedia 3.0.0 Playback state callback Jun 25, 2016
@brianwernick brianwernick added this to the 3.x milestone Jun 25, 2016
@brianwernick brianwernick modified the milestones: 3.1.0, 3.x Jul 15, 2016
@brianwernick
Copy link
Owner

I've been thinking about the best way to achieve a good solution for this and have finally come to a conclusion. In 1.x and 2.x the backing implementations were quite apparent, this is why you could add the ExoPlayerListener; however with the release of 3.0 we moved in a direction where the backing was abstracted away for the most part (you can still see ExoPlayer in things like the RenderBuilder arguments). Now an easy solution would be to wrap the ExoPlayer states and provide those to the user (mapping the MediaPlayer state accordingly) yet that doesn't take advantage of the opportunity to provide future support for things like #102 or to completely separate the VideoControls. @rysh88 created a good proof of this (minus the mapping) in #293 which is what kicked off the thought process.

Since then I have spent the time to play around on my own branch to determine what states would be useful which are listed below; I'm still not 100% convinced all the states listed are necessary (e.g. READY vs PAUSED) but the main concept is there.

PlaybackState.IDLE,
PlaybackState.PREPARING,
PlaybackState.BUFFERING,
PlaybackState.SEEKING,
PlaybackState.READY,
PlaybackState.PLAYING,
PlaybackState.PAUSED,
PlaybackState.COMPLETED,
PlaybackState.STOPPED,
PlaybackState.RELEASED,
PlaybackState.ERROR

Because of this there is quite a bit of work in mapping the states from the ExoPlayer and MediaPlayer and in documenting/determining the state diagram. I still want to get it in the 3.1 release but it may be a while due to the amount of work for this and (hopefully) #115

@brianwernick brianwernick modified the milestones: 3.2.0, 3.1.0 Nov 6, 2016
@brianwernick brianwernick modified the milestones: 4.1.0, 3.2.0 Mar 31, 2017
@erayasan
Copy link

So what is the current situation with this issue ? I have a working video player with google ima sdk for video ads and uses the version 2.5.6. But as you know that version has other issues and bugs. I want to upgrade to the latest version of this library but I really need the state changes for video ad stuff. Do you think that the state change listener could be added soon or should I try something else. Thanks. @brianwernick

@brianwernick
Copy link
Owner

I haven't had a lot of time to work on OSS projects lately; however I'm hoping that I will have enough time in the next month to perform a 4.1 release to include these callbacks but can't promise anything. If it's something you have time to do I'm always open to PR's

@erayasan
Copy link

@brianwernick Ok I will try to work on it, I think I can overcome my needs but not sure that will be as good as to merge it :)

@brianwernick brianwernick self-assigned this Jul 17, 2022
brianwernick added a commit that referenced this issue Aug 2, 2022
…yers use instead of the MediaPlayer directly. This allows us to better standardize handling and keep track of playback state (useful for #257; playback state callback)
brianwernick added a commit that referenced this issue Aug 2, 2022
…yers use instead of the MediaPlayer directly. This allows us to better standardize handling and keep track of playback state (useful for #257; playback state callback) (#757)
Repository owner moved this from In progress to Done in ExoMedia Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants