ovenplayer 0.10.46 → 0.10.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +22 -22
- package/dist/ovenplayer.js +1 -1
- package/dist/ovenplayer.js.map +1 -1
- package/package.json +4 -4
- package/src/js/api/Configurator.js +272 -270
- package/src/js/api/caption/Loader.js +67 -67
- package/src/js/api/caption/Manager.js +143 -141
- package/src/js/api/constants.js +622 -621
- package/src/js/api/provider/html5/Provider.js +570 -563
- package/src/js/api/provider/html5/providers/WebRTCLoader.js +1 -1
- package/src/js/view/components/controls/settingPanel/captionPanel.js +42 -42
- package/src/js/view/components/controls/settingPanel/main.js +321 -321
- package/src/js/view/components/helpers/contextPanel.js +44 -38
- package/src/js/view/components/helpers/contextPanelTemplate.js +19 -9
|
@@ -1,38 +1,44 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by hoho on 2018. 8. 1..
|
|
3
|
-
*/
|
|
4
|
-
import
|
|
5
|
-
import LA$ from 'utils/likeA$';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
$current.css("
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Created by hoho on 2018. 8. 1..
|
|
3
|
+
*/
|
|
4
|
+
import { CONTEXT_ITEM_CLICKED } from 'api/constants';
|
|
5
|
+
import LA$ from 'utils/likeA$';
|
|
6
|
+
import OvenTemplate from 'view/engine/OvenTemplate';
|
|
7
|
+
|
|
8
|
+
const ContextPanel = function($container, api, position){
|
|
9
|
+
const $root = LA$(api.getContainerElement());
|
|
10
|
+
|
|
11
|
+
const onRendered = function($current, template){
|
|
12
|
+
const panelWidth = $current.width();
|
|
13
|
+
const panelHeight = $current.height();
|
|
14
|
+
|
|
15
|
+
const x = Math.min(position.pageX - $root.offset().left, $root.width() - panelWidth);
|
|
16
|
+
const y = Math.min(position.pageY - $root.offset().top, $root.height() - panelHeight);
|
|
17
|
+
|
|
18
|
+
$current.css("left" , x + "px");
|
|
19
|
+
$current.css("top" , y + "px");
|
|
20
|
+
};
|
|
21
|
+
const onDestroyed = function(){
|
|
22
|
+
//Do nothing.
|
|
23
|
+
};
|
|
24
|
+
const events = {
|
|
25
|
+
"click .op-context-item" : function(event, $current, template){
|
|
26
|
+
event.preventDefault();
|
|
27
|
+
const item = $current.find('.op-context-item').get();
|
|
28
|
+
const contextItem = Array.from((item instanceof NodeList) ? item : [item], LA$).find(
|
|
29
|
+
(item) => item.contains(event.target) || item.get() == event.target
|
|
30
|
+
);
|
|
31
|
+
const ident = contextItem?.attr('id');
|
|
32
|
+
if (ident == 'context-player-about') {
|
|
33
|
+
window.open('https://github.com/OvenMediaLabs/OvenPlayer', '_blank');
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
api.getProvider().trigger(CONTEXT_ITEM_CLICKED, ident);
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
return OvenTemplate($container, "ContextPanel", api.getConfig(), api.getConfig().contextItems, events, onRendered, onDestroyed );
|
|
41
|
+
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export default ContextPanel;
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
import {version} from "version";
|
|
2
|
-
export default (uiText) => {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import {version} from "version";
|
|
2
|
+
export default (uiText, items=[]) => {
|
|
3
|
+
let index = 1;
|
|
4
|
+
const contextEl = (item) => {
|
|
5
|
+
const id = item.id ?? `context-item-${index}`;
|
|
6
|
+
return (
|
|
7
|
+
`<div id="${id}" class="op-context-item" tabindex="${index++}">` +
|
|
8
|
+
`<span class="op-context-item-text">${item.label}</span>` +
|
|
9
|
+
`</div>`
|
|
10
|
+
);
|
|
11
|
+
};
|
|
12
|
+
return (
|
|
13
|
+
`<div class="op-context-panel animated fadeIn">` +
|
|
14
|
+
`<div id="context-player-about" class="op-context-item" tabindex="1">` +
|
|
15
|
+
`<span class="op-context-item-text">${uiText.context} ${version}</span>` +
|
|
16
|
+
`</div>` +
|
|
17
|
+
items.map(contextEl).join('') +
|
|
18
|
+
`</div>`
|
|
19
|
+
);
|
|
10
20
|
};
|