Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.

Commit cc2bd82

Browse files
authored
[PBW-7937] fake _ended_ event for some mp4 assets in MS Edge now ignored (#354)
* fix/PBW-7937 fake _ended_ event for some mp4 assets in MS Edge now ignored * fix/PBW-7937 remarks addressed
1 parent f2d6799 commit cc2bd82

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/main/js/main_html5.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ require('../../../html5-common/js/utils/InitModules/InitOOHazmat.js');
1313
require('../../../html5-common/js/utils/constants.js');
1414
require('../../../html5-common/js/utils/utils.js');
1515
require('../../../html5-common/js/utils/environment.js');
16-
1716
(function(_, $) {
1817
let pluginName = 'ooyalaHtml5VideoTech';
1918
let currentInstances = {};
@@ -1394,15 +1393,15 @@ require('../../../html5-common/js/utils/environment.js');
13941393
*/
13951394
const raiseEndedEvent = _.bind(function(event) {
13961395
stopUnderflowWatcher();
1397-
if (
1396+
if (videoEnded || // no double firing ended event
13981397
!_currentUrl || // iOS Safari will trigger an ended event when the source is cleared with an empty string
1399-
(!_video.ended && OO.isSafari)
1400-
) {
1401-
// iOS raises ended events sometimes when a new stream is played in the same video element
1398+
(OO.isEdge && !event) || // Edge fires empty ended event in the beginning on some mp4
1399+
(!_video.ended && OO.isSafari) // iOS raises ended events sometimes when a new stream is played in the same video element
14021400
// Prevent this faulty event from making it to the player message bus
1401+
) {
14031402
return;
14041403
}
1405-
if (videoEnded) { return; } // no double firing ended event.
1404+
14061405
videoEnded = true;
14071406
initialTime.value = 0;
14081407

0 commit comments

Comments
 (0)