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

fix(ios): currentPosition and duration may never equal during playing #570

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

Phecda
Copy link
Contributor

@Phecda Phecda commented Nov 9, 2023

Problem

When play a remote file on iOS, currentPosition may never get to duration, which makes it difficult to know whether the playing is end.

Solution

Add an observer to native player end event, and in that observer, force trigger another playback event, where currentPosition is set to be duration. Note that at this moment, playerItem.currentTime is still smaller than duration, so we cannot use that value.

may fix #328

@shahid-vorksol
Copy link

shahid-vorksol commented Nov 9, 2023

same issue on android...

Copy link
Owner

@hyochan hyochan left a comment

Choose a reason for hiding this comment

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

This looks promising! Let's ship it 🚀

@hyochan hyochan added 📱 iOS Related to iOS 🍗 enhancement New feature or request labels Nov 9, 2023
@hyochan hyochan merged commit 745d5e2 into hyochan:main Nov 9, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍗 enhancement New feature or request 📱 iOS Related to iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

when play audio,e.duration != e.currentPosition
3 participants