Merge pull request #1735 from 138138138/patch-1

iOS audio mode double duration fix
This commit is contained in:
Perflyst 2021-02-26 19:59:23 +01:00 committed by GitHub
commit 489d0151ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -554,4 +554,15 @@ if (player_data.preferred_caption_found) {
player.ready(() => { player.ready(() => {
player.textTracks()[1].mode = 'showing'; player.textTracks()[1].mode = 'showing';
}); });
} }
// Safari audio double duration fix
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);
}
});
});
}