Skip to content

Commit

Permalink
Fix an issue where the UI would not work due to getting the wrong roo…
Browse files Browse the repository at this point in the history
…t element
  • Loading branch information
SangwonOh committed Jan 11, 2022
1 parent e7a7004 commit 92551c0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion dist/ovenplayer.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions src/js/ovenplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@ function ovenPlayerFactory() {

const playerInstance = OvenPlayerSDK.create(player.getMediaElementContainer(), options);

Object.assign(playerInstance, {
getContainerElement: function () {
return containerElement;
},
getContainerId: function () {
return containerElement.id;
}
});

player.setApi(playerInstance);

return playerInstance;
Expand Down
7 changes: 4 additions & 3 deletions src/js/utils/likeA$.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import dom from 'utils/polyfills/dom.js';

const La$ = function(selectorOrElement){
const that = {};

let $element = null;

const returnNode = function($element , selector){
let nodeList = $element.querySelectorAll(selector);
if(nodeList.length > 1){
Expand All @@ -23,8 +26,6 @@ const La$ = function(selectorOrElement){

};

let $element = "";

if( _.isElement(selectorOrElement) || _.every(selectorOrElement, function(item){return _.isElement(item)})){
$element = selectorOrElement;
}else if(selectorOrElement === "document"){
Expand Down Expand Up @@ -158,7 +159,7 @@ const La$ = function(selectorOrElement){
};

that.offset = () =>{ //IE8+
var rect = $element.getBoundingClientRect();
const rect = $element.getBoundingClientRect();

return {
top: rect.top + document.body.scrollTop,
Expand Down
10 changes: 9 additions & 1 deletion src/js/view/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
import '../../stylesheet/ovenplayer.less';

const View = function($container){
let viewTemplate = "", controls = "", helper = "", $playerRoot, contextPanel = "", api = "", autoHideTimer = "", playerState = STATE_IDLE;
let viewTemplate = "", controls = "", helper = "", $playerRoot, contextPanel = "", api = null, autoHideTimer = "", playerState = STATE_IDLE;
let isShiftPressed = false;
let panelManager = PanelManager();
let screenSize = "";
Expand Down Expand Up @@ -311,6 +311,14 @@ const View = function($container){
that.setApi = (playerInstance) => {
api = playerInstance;

api.getContainerElement = () => {
return $playerRoot.get();
};

api.getContainerId = () => {
return $playerRoot.get().id;
};

api.on(READY, function(data) {

if(!controls){
Expand Down

0 comments on commit 92551c0

Please sign in to comment.