ovenplayer 0.10.2 → 0.10.3-3.alpha-2
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 +39 -46
- package/dist/ovenplayer.js +1 -1
- package/dist/ovenplayer.js.map +1 -1
- package/package.json +1 -1
- package/src/assets/fonts/seek-icons.svg +13 -13
- package/src/js/api/Api.js +231 -140
- package/src/js/api/Configurator.js +6 -3
- package/src/js/api/SupportChecker.js +9 -3
- package/src/js/api/constants.js +203 -15
- package/src/js/api/media/Manager.js +15 -106
- package/src/js/api/provider/Controller.js +5 -6
- package/src/js/api/provider/html5/Provider.js +107 -86
- package/src/js/api/provider/html5/providers/Dash.js +39 -110
- package/src/js/api/provider/html5/providers/Hls.js +139 -99
- package/src/js/api/provider/html5/providers/Html5.js +3 -1
- package/src/js/api/provider/html5/providers/WebRTC.js +207 -37
- package/src/js/api/provider/html5/providers/WebRTCLoader.js +247 -116
- package/src/js/ovenplayer.js +5 -9
- package/src/js/ovenplayer.sdk.js +5 -6
- package/src/js/utils/browser.js +6 -1
- package/src/js/utils/getTouchSection.js +23 -0
- package/src/js/utils/likeA$.js +4 -3
- package/src/js/utils/resize-sensor.js +168 -1
- package/src/js/utils/underscore.js +5 -5
- package/src/js/view/components/controls/fullScreenButton.js +22 -15
- package/src/js/view/components/controls/main.js +33 -20
- package/src/js/view/components/controls/playlistPanel.js +1 -1
- package/src/js/view/components/controls/progressBar.js +151 -76
- package/src/js/view/components/controls/settingButton.js +65 -48
- package/src/js/view/components/controls/settingPanel/audioTrackPanel.js +57 -0
- package/src/js/view/components/controls/settingPanel/captionPanel.js +1 -1
- package/src/js/view/components/controls/settingPanel/main.js +110 -80
- package/src/js/view/components/controls/settingPanel/qualityPanel.js +2 -2
- package/src/js/view/components/controls/settingPanel/sourcePanel.js +1 -1
- package/src/js/view/components/controls/settingPanel/speedPanel.js +1 -1
- package/src/js/view/components/controls/settingPanel/timeDisplayPanel.js +1 -1
- package/src/js/view/components/controls/timeDisplay.js +95 -23
- package/src/js/view/components/controls/timeDisplayTemplate.js +1 -1
- package/src/js/view/components/controls/volumeButton.js +2 -3
- package/src/js/view/components/helpers/captionViewer.js +1 -1
- package/src/js/view/components/helpers/contextPanel.js +1 -1
- package/src/js/view/components/helpers/contextPanelTemplate.js +1 -1
- package/src/js/view/components/helpers/main.js +21 -0
- package/src/js/view/components/helpers/thumbnailTemplate.js +0 -1
- package/src/js/view/engine/Templates.js +2 -0
- package/src/js/view/view.js +53 -14
- package/src/js/view/viewTemplate.js +8 -8
- package/src/stylesheet/ovenplayer.less +565 -308
|
@@ -33,9 +33,10 @@ const Configurator = function(options, provider){
|
|
|
33
33
|
systemText : null,
|
|
34
34
|
lang : "en",
|
|
35
35
|
loadingRetryCount: 0,
|
|
36
|
-
expandFullScreenUI:
|
|
36
|
+
expandFullScreenUI: true,
|
|
37
37
|
fullscreenOption: null,
|
|
38
|
-
showBigPlayButton: true
|
|
38
|
+
showBigPlayButton: true,
|
|
39
|
+
doubleTapToSeek: false,
|
|
39
40
|
};
|
|
40
41
|
const serialize = function (val) {
|
|
41
42
|
if (val === undefined) {
|
|
@@ -203,7 +204,9 @@ const Configurator = function(options, provider){
|
|
|
203
204
|
that.getRtmpBufferTimeMax = () => {
|
|
204
205
|
return spec.rtmpBufferTimeMax;
|
|
205
206
|
};
|
|
206
|
-
|
|
207
|
+
that.setMute = (mute) =>{
|
|
208
|
+
spec.mute = mute;
|
|
209
|
+
};
|
|
207
210
|
that.isMute = () =>{
|
|
208
211
|
return spec.mute;
|
|
209
212
|
};
|
|
@@ -43,12 +43,18 @@ const SupportChecker = function(){
|
|
|
43
43
|
|
|
44
44
|
const file = source.file;
|
|
45
45
|
const type = source.type;
|
|
46
|
+
const overrideNative = source.overrideNative;
|
|
46
47
|
|
|
47
48
|
if(!type){return false;}
|
|
48
49
|
const mimeType = source.mimeType || MimeTypes[type];
|
|
49
50
|
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
// Latest Edge browser returns "Chrome" from userAgentObject.browser
|
|
52
|
+
// Make sure to use hls.js Android devices
|
|
53
|
+
if (isHls(file, type) && (userAgentObject.browser === "Microsoft Edge" || userAgentObject.os === "Android")) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (isHls(file, type) && overrideNative) {
|
|
52
58
|
return false;
|
|
53
59
|
}
|
|
54
60
|
|
|
@@ -56,7 +62,7 @@ const SupportChecker = function(){
|
|
|
56
62
|
return false;
|
|
57
63
|
}
|
|
58
64
|
|
|
59
|
-
if(isWebRTC(file, type)){
|
|
65
|
+
if (isWebRTC(file, type)) {
|
|
60
66
|
return false;
|
|
61
67
|
}
|
|
62
68
|
|
package/src/js/api/constants.js
CHANGED
|
@@ -35,8 +35,12 @@ export const PLAYLIST_CHANGED = "playlistChanged";
|
|
|
35
35
|
export const CONTENT_SEEKED = "seeked";
|
|
36
36
|
export const ALL_PLAYLIST_ENDED = "allPlaylistEnded";
|
|
37
37
|
export const NETWORK_UNSTABLED = "unstableNetwork";
|
|
38
|
+
export const HLS_PREPARED = "hlsPrepared";
|
|
39
|
+
export const HLS_DESTROYED = "hlsDestroyed";
|
|
38
40
|
export const DASH_PREPARED = "dashPrepared";
|
|
39
41
|
export const DASH_DESTROYED = "dashDestroyed";
|
|
42
|
+
export const PEER_CONNECTION_PREPARED = "peerConnectionPrepared";
|
|
43
|
+
export const PEER_CONNECTION_DESTROYED = "peerConnectionDestroyed";
|
|
40
44
|
|
|
41
45
|
|
|
42
46
|
|
|
@@ -71,6 +75,7 @@ export const CONTENT_CAPTION_CUE_CHANGED = "cueChanged";
|
|
|
71
75
|
export const CONTENT_CAPTION_CHANGED = "captionChanged";
|
|
72
76
|
export const CONTENT_TIME_MODE_CHANGED = "timeDisplayModeChanged";
|
|
73
77
|
export const OME_P2P_MODE = "p2pMode";
|
|
78
|
+
export const AUDIO_TRACK_CHANGED = "audioTrackChanged";
|
|
74
79
|
|
|
75
80
|
|
|
76
81
|
export const AD_CLIENT_GOOGLEIMA = "googleima";
|
|
@@ -82,8 +87,8 @@ export const INIT_UNSUPPORT_ERROR = 101;
|
|
|
82
87
|
export const INIT_RTMP_SETUP_ERROR = 102;
|
|
83
88
|
export const INIT_DASH_UNSUPPORT = 103;
|
|
84
89
|
export const INIT_ADS_ERROR = 104;
|
|
85
|
-
export const
|
|
86
|
-
export const
|
|
90
|
+
export const INIT_DASH_FAIL = 105;
|
|
91
|
+
export const INIT_HLSJS_FAIL = 106;
|
|
87
92
|
export const PLAYER_UNKNWON_ERROR = 300;
|
|
88
93
|
export const PLAYER_UNKNWON_OPERATION_ERROR = 301;
|
|
89
94
|
export const PLAYER_UNKNWON_NETWORK_ERROR = 302;
|
|
@@ -98,8 +103,10 @@ export const PLAYER_WEBRTC_ADD_ICECANDIDATE_ERROR = 502;
|
|
|
98
103
|
export const PLAYER_WEBRTC_SET_REMOTE_DESC_ERROR = 503;
|
|
99
104
|
export const PLAYER_WEBRTC_CREATE_ANSWER_ERROR = 504;
|
|
100
105
|
export const PLAYER_WEBRTC_SET_LOCAL_DESC_ERROR = 505;
|
|
106
|
+
export const PLAYER_WEBRTC_INTERNAL_ERROR = 506;
|
|
101
107
|
export const PLAYER_WEBRTC_NETWORK_SLOW = 510;
|
|
102
108
|
export const PLAYER_WEBRTC_UNEXPECTED_DISCONNECT = 511;
|
|
109
|
+
export const PLAYER_WEBRTC_TIMEOUT = 512;
|
|
103
110
|
|
|
104
111
|
export const WARN_MSG_MUTEDPLAY = "Please touch here to turn on the sound.";
|
|
105
112
|
|
|
@@ -130,6 +137,7 @@ export const SYSTEM_TEXT = [
|
|
|
130
137
|
"speedUnit" : "x",
|
|
131
138
|
"source" : "Source",
|
|
132
139
|
"quality" : "Quality",
|
|
140
|
+
"audioTrack" : "Audio",
|
|
133
141
|
"caption" : "Caption",
|
|
134
142
|
"display" : "Display"
|
|
135
143
|
}
|
|
@@ -156,8 +164,8 @@ export const SYSTEM_TEXT = [
|
|
|
156
164
|
},
|
|
157
165
|
103: {
|
|
158
166
|
"code": 103,
|
|
159
|
-
"message": "Can not load due to
|
|
160
|
-
"reason": "dash.js version is old.
|
|
167
|
+
"message": "Can not load due to dash.js. Please use the latest dash.js.",
|
|
168
|
+
"reason": "dash.js version is old."
|
|
161
169
|
},
|
|
162
170
|
104: {
|
|
163
171
|
"code": 104,
|
|
@@ -166,13 +174,13 @@ export const SYSTEM_TEXT = [
|
|
|
166
174
|
},
|
|
167
175
|
105: {
|
|
168
176
|
"code": 105,
|
|
169
|
-
"message": "
|
|
170
|
-
"reason": "
|
|
177
|
+
"message": "Error initializing DASH.",
|
|
178
|
+
"reason": "Error initializing DASH."
|
|
171
179
|
},
|
|
172
180
|
106: {
|
|
173
181
|
"code": 106,
|
|
174
|
-
"message": "
|
|
175
|
-
"reason": "
|
|
182
|
+
"message": "Error initializing HLS.",
|
|
183
|
+
"reason": "Error initializing HLS."
|
|
176
184
|
},
|
|
177
185
|
300: {
|
|
178
186
|
"code": 300,
|
|
@@ -244,6 +252,11 @@ export const SYSTEM_TEXT = [
|
|
|
244
252
|
"message": "Connection with low-latency(OME) server failed.",
|
|
245
253
|
"reason": "WebRTC setLocalDescription failed."
|
|
246
254
|
},
|
|
255
|
+
506: {
|
|
256
|
+
"code": 506,
|
|
257
|
+
"message": "Connection with low-latency(OME) server failed.",
|
|
258
|
+
"reason": "WebRTC internal error."
|
|
259
|
+
},
|
|
247
260
|
510: {
|
|
248
261
|
"code": 510,
|
|
249
262
|
"message": "Network connection is unstable. Check the network connection.",
|
|
@@ -253,6 +266,11 @@ export const SYSTEM_TEXT = [
|
|
|
253
266
|
"code": 511,
|
|
254
267
|
"message": "Connection with low-latency(OME) terminated unexpectedly.",
|
|
255
268
|
"reason": "Unexpected end of connection."
|
|
269
|
+
},
|
|
270
|
+
512: {
|
|
271
|
+
"code": 512,
|
|
272
|
+
"message": "Connection with low-latency(OME) server failed.",
|
|
273
|
+
"reason": "Connection timeout."
|
|
256
274
|
}
|
|
257
275
|
}
|
|
258
276
|
}
|
|
@@ -273,6 +291,7 @@ export const SYSTEM_TEXT = [
|
|
|
273
291
|
"speedUnit" : "x",
|
|
274
292
|
"source" : "소스",
|
|
275
293
|
"quality" : "품질",
|
|
294
|
+
"audioTrack" : "오디오",
|
|
276
295
|
"caption" : "자막",
|
|
277
296
|
"display" : "표시"
|
|
278
297
|
}
|
|
@@ -299,8 +318,8 @@ export const SYSTEM_TEXT = [
|
|
|
299
318
|
},
|
|
300
319
|
103: {
|
|
301
320
|
"code": 103,
|
|
302
|
-
"message": "DashJS로 인해 로드 할 수 없습니다.
|
|
303
|
-
"reason": "dash.js version is old.
|
|
321
|
+
"message": "DashJS로 인해 로드 할 수 없습니다. 최신 dash.js를 사용해 주세요.",
|
|
322
|
+
"reason": "dash.js version is old."
|
|
304
323
|
},
|
|
305
324
|
104: {
|
|
306
325
|
"code": 104,
|
|
@@ -309,13 +328,13 @@ export const SYSTEM_TEXT = [
|
|
|
309
328
|
},
|
|
310
329
|
105: {
|
|
311
330
|
"code": 105,
|
|
312
|
-
"message": "
|
|
313
|
-
"reason": "
|
|
331
|
+
"message": "DASH 초기화 중 오류가 발생했습니다.",
|
|
332
|
+
"reason": "Error initializing DASH."
|
|
314
333
|
},
|
|
315
334
|
106: {
|
|
316
335
|
"code": 106,
|
|
317
|
-
"message": "
|
|
318
|
-
"reason": "
|
|
336
|
+
"message": "HLS 초기화 중 오류가 발생했습니다.",
|
|
337
|
+
"reason": "Error initializing HLS."
|
|
319
338
|
},
|
|
320
339
|
300: {
|
|
321
340
|
"code": 300,
|
|
@@ -387,12 +406,181 @@ export const SYSTEM_TEXT = [
|
|
|
387
406
|
"message": "저지연(OME) 서버와 연결에 실패했습니다.",
|
|
388
407
|
"reason": "WebRTC setLocalDescription failed."
|
|
389
408
|
},
|
|
409
|
+
506: {
|
|
410
|
+
"code": 506,
|
|
411
|
+
"message": "저지연(OME) 서버와 연결에 실패했습니다.",
|
|
412
|
+
"reason": "WebRTC internal error."
|
|
413
|
+
},
|
|
390
414
|
510: {
|
|
391
415
|
"code": 510,
|
|
392
416
|
"message": "네트워크 연결이 불안정합니다. 네트워크 연결을 확인하십시오.",
|
|
393
417
|
"reason": "Network is slow."
|
|
418
|
+
},
|
|
419
|
+
511: {
|
|
420
|
+
"code": 511,
|
|
421
|
+
"message": "저지연(OME) 서버와 연결에 실패했습니다.",
|
|
422
|
+
"reason": "Unexpected end of connection."
|
|
423
|
+
},
|
|
424
|
+
512: {
|
|
425
|
+
"code": 512,
|
|
426
|
+
"message": "저지연(OME) 서버와 연결에 실패했습니다.",
|
|
427
|
+
"reason": "Connection timeout."
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
"lang" : "pl",
|
|
434
|
+
"ui" : {
|
|
435
|
+
"context" : "O OvenPlayer",
|
|
436
|
+
"controls" : {
|
|
437
|
+
"live" : "Transmisja na żywo",
|
|
438
|
+
"low_latency_live" : "Transmisja z niskim opóźnieniem",
|
|
439
|
+
"low_latency_p2p" : "Transmisja z niskim opóźnieniem P2P",
|
|
440
|
+
},
|
|
441
|
+
"playlist" : "Playlista",
|
|
442
|
+
"setting" : {
|
|
443
|
+
"title" : "Ustawienia",
|
|
444
|
+
"speed" : "Prędkość",
|
|
445
|
+
"speedUnit" : "x",
|
|
446
|
+
"source" : "Źrodło",
|
|
447
|
+
"quality" : "Jakość",
|
|
448
|
+
"audioTrack" : "Audio",
|
|
449
|
+
"caption" : "Podtytuł",
|
|
450
|
+
"display" : "Wyświetlacz"
|
|
451
|
+
}
|
|
452
|
+
},
|
|
453
|
+
"api" : {
|
|
454
|
+
"message" : {
|
|
455
|
+
"muted_play" : "Naciśnij tutaj, aby aktywować dźwięk"
|
|
456
|
+
},
|
|
457
|
+
"error": {
|
|
458
|
+
100: {
|
|
459
|
+
"code": 100,
|
|
460
|
+
"message": "Nie można załadować z nieznanego powodu.",
|
|
461
|
+
"reason": "Can not load due to unknown reasons."
|
|
462
|
+
},
|
|
463
|
+
101: {
|
|
464
|
+
"code": 101,
|
|
465
|
+
"message": "Nie można załadować, ponieważ nie znaleziono multimediów, który można odtworzyć.",
|
|
466
|
+
"reason": "Can not load due to playable media not found."
|
|
467
|
+
},
|
|
468
|
+
102: {
|
|
469
|
+
"code": 102,
|
|
470
|
+
"message": "Flash fetching process aborted. </br><a href='http://www.adobe.com/go/getflashplayer' target='_self'><img src='http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player'></a>",
|
|
471
|
+
"reason": "It looks like not found swf or your environment is localhost."
|
|
472
|
+
},
|
|
473
|
+
103: {
|
|
474
|
+
"code": 103,
|
|
475
|
+
"message": "Nie można załadować, ponieważ wersja dash.js jest za stara.",
|
|
476
|
+
"reason": "dash.js version is old."
|
|
477
|
+
},
|
|
478
|
+
104: {
|
|
479
|
+
"code": 104,
|
|
480
|
+
"message": "Can not load due to google ima for Ads. ",
|
|
481
|
+
"reason": "Please check the google ima library."
|
|
482
|
+
},
|
|
483
|
+
105: {
|
|
484
|
+
"code": 105,
|
|
485
|
+
"message": "Nie można załadować, nie znaleziono DASH.",
|
|
486
|
+
"reason": "Error initializing DASH."
|
|
487
|
+
},
|
|
488
|
+
106: {
|
|
489
|
+
"code": 106,
|
|
490
|
+
"message": "Nie można załadować, nie znaleziono hlsjs.",
|
|
491
|
+
"reason": "Error initializing HLS"
|
|
492
|
+
},
|
|
493
|
+
300: {
|
|
494
|
+
"code": 300,
|
|
495
|
+
"message": "Nie można odtworzyć z nieznanego powodu.",
|
|
496
|
+
"reason": "Can not play due to unknown reasons."
|
|
497
|
+
},
|
|
498
|
+
301: {
|
|
499
|
+
"code": 301,
|
|
500
|
+
"message": "Proces pobierania przerwany przez użytkownika.",
|
|
501
|
+
"reason": "Fetching process aborted by user."
|
|
502
|
+
},
|
|
503
|
+
302: {
|
|
504
|
+
"code": 302,
|
|
505
|
+
"message": "Nie udało się pobrać niektórych multimediów z powodu błędu sieci.",
|
|
506
|
+
"reason": "Error occurred when downloading."
|
|
507
|
+
},
|
|
508
|
+
303: {
|
|
509
|
+
"code": 303,
|
|
510
|
+
"message": "Nie udało się załadować niektórych multimediów. Może być to spowodowane problemem z serwerem, siecią lub niewspieranym formatem.",
|
|
511
|
+
"reason": "Error occurred when decoding."
|
|
512
|
+
},
|
|
513
|
+
304: {
|
|
514
|
+
"code": 304,
|
|
515
|
+
"message": "Odtwarzanie zostało anulowane. Wygląda na to, że plik jest uszkodzony lub Twoja przeglądarka nie obsługuje tego pliku.",
|
|
516
|
+
"reason": "Media playback not supported."
|
|
517
|
+
},
|
|
518
|
+
305: {
|
|
519
|
+
"code": 305,
|
|
520
|
+
"message": "Nie można wczytać napisów z nieznanego powodu.",
|
|
521
|
+
"reason": "Can not load captions due to unknown reasons."
|
|
522
|
+
},
|
|
523
|
+
306: {
|
|
524
|
+
"code": 306,
|
|
525
|
+
"message": "Nie udało się załadować niektórych multimediów. Może być to spowodowane problemem z serwerem, siecią lub niewspieranym formatem.",
|
|
526
|
+
"reason": "The server cannot or will not process the request."
|
|
527
|
+
},
|
|
528
|
+
307: {
|
|
529
|
+
"code": 307,
|
|
530
|
+
"message": "Nie udało się załadować niektórych multimediów. Może być to spowodowane problemem z serwerem, siecią lub niewspieranym formatem.",
|
|
531
|
+
"reason": "The server refused the request."
|
|
532
|
+
},
|
|
533
|
+
308: {
|
|
534
|
+
"code": 308,
|
|
535
|
+
"message": "Nie udało się załadować niektórych multimediów. Może być to spowodowane problemem z serwerem, siecią lub niewspieranym formatem.",
|
|
536
|
+
"reason": "The server do not accept the request."
|
|
537
|
+
},
|
|
538
|
+
501: {
|
|
539
|
+
"code": 501,
|
|
540
|
+
"message": "Połączenie z serwerem niskiego opóźnienia (OME) nie powiodło się.",
|
|
541
|
+
"reason": "WebSocket connection failed."
|
|
542
|
+
},
|
|
543
|
+
502: {
|
|
544
|
+
"code": 502,
|
|
545
|
+
"message": "Połączenie z serwerem niskiego opóźnienia (OME) nie powiodło się.",
|
|
546
|
+
"reason": "WebRTC addIceCandidate failed."
|
|
547
|
+
},
|
|
548
|
+
503: {
|
|
549
|
+
"code": 503,
|
|
550
|
+
"message": "Połączenie z serwerem niskiego opóźnienia (OME) nie powiodło się.",
|
|
551
|
+
"reason": "WebRTC setRemoteDescription failed."
|
|
552
|
+
},
|
|
553
|
+
504: {
|
|
554
|
+
"code": 504,
|
|
555
|
+
"message": "Połączenie z serwerem niskiego opóźnienia (OME) nie powiodło się.",
|
|
556
|
+
"reason": "WebRTC peer createOffer failed."
|
|
557
|
+
},
|
|
558
|
+
505: {
|
|
559
|
+
"code": 505,
|
|
560
|
+
"message": "Połączenie z serwerem niskiego opóźnienia (OME) nie powiodło się.",
|
|
561
|
+
"reason": "WebRTC setLocalDescription failed."
|
|
562
|
+
},
|
|
563
|
+
506: {
|
|
564
|
+
"code": 506,
|
|
565
|
+
"message": "Połączenie z serwerem niskiego opóźnienia (OME) nie powiodło się.",
|
|
566
|
+
"reason": "WebRTC internal error."
|
|
567
|
+
},
|
|
568
|
+
510: {
|
|
569
|
+
"code": 510,
|
|
570
|
+
"message": "Połączenie sieciowe jest niestabilne. Sprawdź swoją sieć.",
|
|
571
|
+
"reason": "Network is slow."
|
|
572
|
+
},
|
|
573
|
+
511: {
|
|
574
|
+
"code": 511,
|
|
575
|
+
"message": "Połączenie z serwerem niskiego opóźnienia (OME) nieoczekiwanie zakończone.",
|
|
576
|
+
"reason": "Unexpected end of connection."
|
|
577
|
+
},
|
|
578
|
+
512: {
|
|
579
|
+
"code": 512,
|
|
580
|
+
"message": "Połączenie z serwerem niskiego opóźnienia (OME) nie powiodło się.",
|
|
581
|
+
"reason": "Connection timeout."
|
|
394
582
|
}
|
|
395
583
|
}
|
|
396
584
|
}
|
|
397
585
|
}
|
|
398
|
-
];
|
|
586
|
+
];
|
|
@@ -10,8 +10,6 @@ import {version} from 'version';
|
|
|
10
10
|
|
|
11
11
|
const Manager = function(container, browserInfo){
|
|
12
12
|
const that = {};
|
|
13
|
-
const SWFPath = '';
|
|
14
|
-
let rootId = container.getAttribute("data-parent-id");
|
|
15
13
|
let $container = LA$(container);
|
|
16
14
|
let videoElement = "";
|
|
17
15
|
|
|
@@ -20,6 +18,7 @@ const Manager = function(container, browserInfo){
|
|
|
20
18
|
const createHtmlVideo = function(isLoop, isAutoStart){
|
|
21
19
|
|
|
22
20
|
videoElement = document.createElement('video');
|
|
21
|
+
videoElement.setAttribute('preload', 'auto');
|
|
23
22
|
videoElement.setAttribute('disableremoteplayback', '');
|
|
24
23
|
videoElement.setAttribute('webkit-playsinline', 'true');
|
|
25
24
|
videoElement.setAttribute('playsinline', 'true');
|
|
@@ -33,111 +32,19 @@ const Manager = function(container, browserInfo){
|
|
|
33
32
|
|
|
34
33
|
return videoElement;
|
|
35
34
|
};
|
|
36
|
-
const createFlashVideo = function(isLoop, bufferTime, bufferTimeMax){
|
|
37
|
-
let movie, flashvars, allowscriptaccess, allowfullscreen, quality, name, menu, qual, bgcolor, loop, wmode ;
|
|
38
|
-
OvenPlayerConsole.log("MediaManager Flash buffer setting : ", bufferTime, bufferTimeMax);
|
|
39
|
-
movie = document.createElement('param');
|
|
40
|
-
movie.setAttribute('name', 'movie');
|
|
41
|
-
movie.setAttribute('value', SWFPath);
|
|
42
|
-
|
|
43
|
-
flashvars = document.createElement('param');
|
|
44
|
-
flashvars.setAttribute('name', 'flashvars');
|
|
45
|
-
//playerId is to use SWF for ExternalInterface.call().
|
|
46
|
-
flashvars.setAttribute('value', `playerId=${rootId}&bufferTime=${bufferTime}&bufferMaxTime=${bufferTimeMax}`);
|
|
47
|
-
|
|
48
|
-
allowscriptaccess = document.createElement('param');
|
|
49
|
-
allowscriptaccess.setAttribute('name', 'allowscriptaccess');
|
|
50
|
-
allowscriptaccess.setAttribute('value', 'always');
|
|
51
|
-
|
|
52
|
-
allowfullscreen = document.createElement('param');
|
|
53
|
-
allowfullscreen.setAttribute('name', 'allowfullscreen');
|
|
54
|
-
allowfullscreen.setAttribute('value', 'true');
|
|
55
|
-
|
|
56
|
-
quality = document.createElement('param');
|
|
57
|
-
quality.setAttribute('name', 'quality');
|
|
58
|
-
quality.setAttribute('value', 'height');
|
|
59
|
-
|
|
60
|
-
name = document.createElement('param');
|
|
61
|
-
name.setAttribute('name', 'name');
|
|
62
|
-
name.setAttribute('value', rootId+"-flash");
|
|
63
|
-
|
|
64
|
-
menu = document.createElement('param');
|
|
65
|
-
menu.setAttribute('name', 'menu');
|
|
66
|
-
menu.setAttribute('value', 'false');
|
|
67
|
-
|
|
68
|
-
qual = document.createElement('param');
|
|
69
|
-
qual.setAttribute('name', 'quality');
|
|
70
|
-
qual.setAttribute('value', 'high');
|
|
71
|
-
|
|
72
|
-
bgcolor = document.createElement('param');
|
|
73
|
-
bgcolor.setAttribute('name', 'bgcolor');
|
|
74
|
-
bgcolor.setAttribute('value', '#000000');
|
|
75
|
-
|
|
76
|
-
wmode = document.createElement('param');
|
|
77
|
-
wmode.setAttribute('name', 'wmode');
|
|
78
|
-
wmode.setAttribute('value', 'opaque');
|
|
79
|
-
|
|
80
|
-
/*let allowButton = `<a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player"></a>`;
|
|
81
|
-
message = document.createElement("div");
|
|
82
|
-
message.innerHTML = allowButton;*/
|
|
83
|
-
|
|
84
|
-
if(isLoop){
|
|
85
|
-
loop = document.createElement('param');
|
|
86
|
-
loop.setAttribute('name', 'loop');
|
|
87
|
-
loop.setAttribute('value', 'true');
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
videoElement = document.createElement('object');
|
|
91
|
-
videoElement.setAttribute('id', rootId+"-flash");
|
|
92
|
-
videoElement.setAttribute('name', rootId+"-flash");
|
|
93
|
-
videoElement.setAttribute('width', '100%');
|
|
94
|
-
videoElement.setAttribute('height', '100%');
|
|
95
|
-
videoElement.setAttribute('scale', 'default');
|
|
96
|
-
videoElement.setAttribute('wmode', 'opaque');
|
|
97
|
-
|
|
98
|
-
if(browserInfo.browser === "Microsoft Internet Explorer" && browserInfo.browserMajorVersion <= 9 ){
|
|
99
|
-
videoElement.setAttribute('classid', 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000');
|
|
100
|
-
videoElement.appendChild(movie);
|
|
101
|
-
}else{
|
|
102
|
-
videoElement.setAttribute('data', SWFPath);
|
|
103
|
-
videoElement.setAttribute('type', 'application/x-shockwave-flash');
|
|
104
|
-
}
|
|
105
|
-
if(isLoop){
|
|
106
|
-
videoElement.appendChild(loop);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
videoElement.appendChild(wmode);
|
|
110
|
-
videoElement.appendChild(bgcolor);
|
|
111
|
-
videoElement.appendChild(qual);
|
|
112
|
-
videoElement.appendChild(allowfullscreen);
|
|
113
|
-
videoElement.appendChild(allowscriptaccess);
|
|
114
|
-
videoElement.appendChild(flashvars);
|
|
115
|
-
//videoElement.appendChild(message);
|
|
116
|
-
|
|
117
|
-
$container.append(videoElement);
|
|
118
|
-
|
|
119
|
-
return videoElement;
|
|
120
|
-
};
|
|
121
35
|
|
|
122
36
|
that.createMedia = (providerName , playerConfig) => {
|
|
123
|
-
if(
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
// return videoElement;
|
|
135
|
-
// }else{
|
|
136
|
-
// return createHtmlVideo(playerConfig.isLoop(), playerConfig.isAutoStart());
|
|
137
|
-
// }
|
|
138
|
-
that.empty();
|
|
139
|
-
return createHtmlVideo(playerConfig.isLoop(), playerConfig.isAutoStart());
|
|
140
|
-
}
|
|
37
|
+
// if(videoElement){
|
|
38
|
+
// // that.empty();
|
|
39
|
+
// //reuse video element.
|
|
40
|
+
// //because playlist is auto next playing.
|
|
41
|
+
// //Only same video element does not require User Interaction Error.
|
|
42
|
+
// return videoElement;
|
|
43
|
+
// }else{
|
|
44
|
+
// return createHtmlVideo(playerConfig.isLoop(), playerConfig.isAutoStart());
|
|
45
|
+
// }
|
|
46
|
+
that.empty();
|
|
47
|
+
return createHtmlVideo(playerConfig.isLoop(), playerConfig.isAutoStart());
|
|
141
48
|
}
|
|
142
49
|
|
|
143
50
|
that.createAdContainer = () => {
|
|
@@ -158,8 +65,10 @@ const Manager = function(container, browserInfo){
|
|
|
158
65
|
that.destroy = () =>{
|
|
159
66
|
$container.removeChild();
|
|
160
67
|
$container = null;
|
|
68
|
+
if(videoElement!=null && videoElement!=='') {
|
|
69
|
+
videoElement.srcObject = null;
|
|
70
|
+
}
|
|
161
71
|
videoElement = null;
|
|
162
|
-
rootId = null;
|
|
163
72
|
};
|
|
164
73
|
|
|
165
74
|
return that;
|
|
@@ -10,10 +10,9 @@ import {
|
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @brief This manages provider.
|
|
13
|
-
* @param
|
|
14
13
|
* */
|
|
15
14
|
const Controller = function () {
|
|
16
|
-
let
|
|
15
|
+
let supportChecker = SupportChecker();
|
|
17
16
|
const Providers = {};
|
|
18
17
|
|
|
19
18
|
const that = {};
|
|
@@ -56,7 +55,7 @@ const Controller = function () {
|
|
|
56
55
|
|
|
57
56
|
|
|
58
57
|
that.loadProviders = (playlistItem) => {
|
|
59
|
-
const supportedProviderNames =
|
|
58
|
+
const supportedProviderNames = supportChecker.findProviderNamesByPlaylist(playlistItem);
|
|
60
59
|
OvenPlayerConsole.log("ProviderController loadProviders() ", supportedProviderNames);
|
|
61
60
|
if (!supportedProviderNames) {
|
|
62
61
|
return Promise.reject(ERRORS.codes[INIT_UNSUPPORT_ERROR]);
|
|
@@ -78,14 +77,14 @@ const Controller = function () {
|
|
|
78
77
|
};
|
|
79
78
|
|
|
80
79
|
that.getProviderBySource = (source) => {
|
|
81
|
-
const supportedProviderName =
|
|
80
|
+
const supportedProviderName = supportChecker.findProviderNameBySource(source);
|
|
82
81
|
OvenPlayerConsole.log("ProviderController getProviderBySource() ", supportedProviderName);
|
|
83
82
|
return that.findByName(supportedProviderName);
|
|
84
83
|
};
|
|
85
84
|
|
|
86
85
|
that.isSameProvider = (currentSource, newSource) => {
|
|
87
|
-
OvenPlayerConsole.log("ProviderController isSameProvider() ",
|
|
88
|
-
return
|
|
86
|
+
OvenPlayerConsole.log("ProviderController isSameProvider() ", supportChecker.findProviderNameBySource(currentSource), supportChecker.findProviderNameBySource(newSource));
|
|
87
|
+
return supportChecker.findProviderNameBySource(currentSource) === supportChecker.findProviderNameBySource(newSource);
|
|
89
88
|
};
|
|
90
89
|
|
|
91
90
|
return that;
|