Merge pull request #2990 from 138138138/master

Safari audio double duration fix for iOS 15
This commit is contained in:
Samantaz Fox 2022-04-03 15:01:30 +02:00 committed by GitHub
commit 0fa0e8e3f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -675,8 +675,8 @@ if (player_data.preferred_caption_found) {
if (navigator.vendor == "Apple Computer, Inc." && video_data.params.listen) {
player.on('loadedmetadata', function () {
player.on('timeupdate', function () {
if (player.remainingTime() < player.duration() / 2) {
player.currentTime(player.duration() + 1);
if (player.remainingTime() < player.duration() / 2 && player.remainingTime() >= 2) {
player.currentTime(player.duration() - 1);
}
});
});