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

Bugfix/playbutton ended state #33

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

wvanhaevre
Copy link
Collaborator

At the very beginning of the stream, on iOS, the currentTime is 0 and without preloading so is the duration. In that case currentTime == duration which makes the playButton assume an ended state upon initialisation.

@@ -46,7 +46,7 @@ export class PlayButton extends PureComponent<PlayButtonProps, PlayButtonState>
context.player.addEventListener(PlayerEventType.SEEKING, this.onSeeking);
this.setState({
paused: context.player.paused,
ended: context.player.currentTime === context.player.duration,
ended: (context.player.duration > 0) && (context.player.currentTime === context.player.duration),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does context.player.ended not work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Would make sense indeed. But I just noticed we don't have this on our API. We're only supporting the ENDED event but never store it as a state.

Copy link

@Danesz Danesz Aug 13, 2024

Choose a reason for hiding this comment

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

maybe it would make sense to rely on something that's "ended" (or the property or the event), because I think on iOS we had an issue where the duration wasn't equal to the last currentTime.

Afaik it was fixed and it dispatches the ended event (and reflects it on the property too)
Otherwise, we reintroduce the same issue on the RN level.

(on the other hand, it would be nice if iOS could update the duration properly too, if possible to detect the duration change (if any))

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.

4 participants