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

Gh 101 implement set playlist item callback #128

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

normtronics
Copy link

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

@normtronics normtronics requested a review from a team as a code owner February 24, 2025 04:12
Copy link
Contributor

@hunyoboy hunyoboy left a 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;
Copy link
Contributor

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);
Copy link
Contributor

@hunyoboy hunyoboy Feb 25, 2025

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -348,6 +350,8 @@ class RNJWPlayerView : UIView, JWPlayerDelegate, JWPlayerStateDelegate, JWAdDele
self.setupPlayerViewController(config: config, playerConfig: jwConfig!)
}
}

self.setupPlaylistItemCallback()
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants