-
Notifications
You must be signed in to change notification settings - Fork 10
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
Gh 101 implement set playlist item callback #128
base: master
Are you sure you want to change the base?
Gh 101 implement set playlist item callback #128
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@normtronics, thanks for this PR. Also deferring to @Jmilham21 for a suggestion on how we can cleanly apply our use case without affecting other library users.
@@ -129,6 +129,7 @@ | |||
import java.util.List; | |||
import java.util.Map; | |||
import java.util.Objects; | |||
import java.util.function.Consumer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@normtronics not needed.
mPlayer.allowBackgroundAudio(backgroundAudioEnabled); | ||
mPlayer.setPlaylistItemCallbackListener(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@normtronics this requires all lib. users to use onBeforeNextPlaylistItem
on the js side. in fact, it'll never load the playlist items after the first one if they don't use that callback and resolve back the playlistItems
. the logic i think should be - call this line only if onBeforeNextPlaylistItem
is set on the js side. @Jmilham21 any idea how we can cleanly achieve this?
it's not big of a deal on ios but its safer/cleaner if the same logic is applied as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove this listener when the player is destroyed as well - https://github.com/jwplayer/jwplayer-react-native/blob/master/android/src/main/java/com/jwplayer/rnjwplayer/RNJWPlayerView.java#L364
@@ -348,6 +350,8 @@ class RNJWPlayerView : UIView, JWPlayerDelegate, JWPlayerStateDelegate, JWAdDele | |||
self.setupPlayerViewController(config: config, playerConfig: jwConfig!) | |||
} | |||
} | |||
|
|||
self.setupPlaylistItemCallback() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@normtronics same idea on android. please set only when onBeforeNextPlaylistItem
callback is set on the js side.
What does this Pull Request do?
This PR is to implement #101
Why is this Pull Request needed?
Its to implement #101
Are there any points in the code the reviewer needs to double check?
Are there any Pull Requests open in other repos which need to be merged with this?
No
Addresses Issue(s):
GitHub Issue