Skip to content

Commit

Permalink
Fix the problem that other elements could not be dragged on the web page
Browse files Browse the repository at this point in the history
containing OvenPlayer
  • Loading branch information
SangwonOh committed Aug 2, 2021
1 parent a36cf03 commit 29776b9
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 30 deletions.
2 changes: 1 addition & 1 deletion dist/development/ovenplayer/COMMITHASH
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fc427dc9812322fb289a4a8ac05be55b57614f1e
a36cf03101172f3d9cfd588c4125800edf290243
2 changes: 1 addition & 1 deletion dist/development/ovenplayer/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fc427dc
a36cf03
31 changes: 17 additions & 14 deletions dist/development/ovenplayer/ovenplayer.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/development/ovenplayer/ovenplayer.sdk.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/production/ovenplayer/COMMITHASH
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fc427dc9812322fb289a4a8ac05be55b57614f1e
a36cf03101172f3d9cfd588c4125800edf290243
2 changes: 1 addition & 1 deletion dist/production/ovenplayer/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fc427dc
a36cf03
2 changes: 1 addition & 1 deletion dist/production/ovenplayer/ovenplayer.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/production/ovenplayer/ovenplayer.sdk.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/production/ovenplayer/report.html

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions src/js/view/components/controls/progressBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,6 @@ const ProgressBar = function($container, api, isAd){
drawHoverProgress(percentage);
drawTimeIndicator(percentage, event);
}
},
"mousemove document" : function(event, $current, template){

event.preventDefault();

if (mouseDown && !isMobile) {
const percentage = calculatePercentage(event);
Expand All @@ -370,7 +366,7 @@ const ProgressBar = function($container, api, isAd){
drawTimeIndicator(percentage, event);
}
},
"mouseup document" : function(event, $current, template){
"mouseup .op-progressbar" : function(event, $current, template){

event.preventDefault();

Expand Down
11 changes: 9 additions & 2 deletions src/js/view/engine/OvenTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,26 @@ const OvenTemplate = function (container, templateName, playerConfig, data, even
}
}, true);*/

let eventOption = null;

if (eventName.indexOf('touch') > -1) {
eventOption = { passive: true };
}

//sometimes target is NodeList
let nodeLength = $target.get().length;

if(nodeLength > 1){
let nodeList = $target.get();
for(let i = 0; i < nodeLength; i ++){
nodeList[i].addEventListener(eventName, wrappedFunc);
nodeList[i].addEventListener(eventName, wrappedFunc, eventOption);
}
//IE NodeList doesn't have forEach. It's wack.
//$target.get().forEach(function($item){
// $item.addEventListener(eventName, wrappedFunc);
//});
}else{
$target.get().addEventListener(eventName, wrappedFunc);
$target.get().addEventListener(eventName, wrappedFunc, eventOption);
}


Expand Down

0 comments on commit 29776b9

Please sign in to comment.