Skip to content

Commit

Permalink
[PBW-7937] fake _ended_ event for some mp4 assets in MS Edge now igno…
Browse files Browse the repository at this point in the history
…red (#354)

* fix/PBW-7937 fake _ended_ event for some mp4 assets in MS Edge now ignored

* fix/PBW-7937 remarks addressed
  • Loading branch information
zelibobla authored May 8, 2019
1 parent f2d6799 commit cc2bd82
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/main/js/main_html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ require('../../../html5-common/js/utils/InitModules/InitOOHazmat.js');
require('../../../html5-common/js/utils/constants.js');
require('../../../html5-common/js/utils/utils.js');
require('../../../html5-common/js/utils/environment.js');

(function(_, $) {
let pluginName = 'ooyalaHtml5VideoTech';
let currentInstances = {};
Expand Down Expand Up @@ -1394,15 +1393,15 @@ require('../../../html5-common/js/utils/environment.js');
*/
const raiseEndedEvent = _.bind(function(event) {
stopUnderflowWatcher();
if (
if (videoEnded || // no double firing ended event
!_currentUrl || // iOS Safari will trigger an ended event when the source is cleared with an empty string
(!_video.ended && OO.isSafari)
) {
// iOS raises ended events sometimes when a new stream is played in the same video element
(OO.isEdge && !event) || // Edge fires empty ended event in the beginning on some mp4
(!_video.ended && OO.isSafari) // iOS raises ended events sometimes when a new stream is played in the same video element
// Prevent this faulty event from making it to the player message bus
) {
return;
}
if (videoEnded) { return; } // no double firing ended event.

videoEnded = true;
initialTime.value = 0;

Expand Down

0 comments on commit cc2bd82

Please sign in to comment.