Skip to content

Commit 12c8a97

Browse files
authored
Merge pull request #49 from yama-dev/v6.1.2
V6.1.2
2 parents 8d83e88 + 8827f0c commit 12c8a97

11 files changed

+162
-107
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
SLUG=js-player-module-brightcove
2-
VERSION=6.1.0
2+
VERSION=6.1.2

@types/index.d.ts

Lines changed: 3 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,9 @@
11

2-
declare function test(): string;
2+
declare module '@yama-dev/js-dom';
33

4-
interface MyInterface{
5-
name: string
6-
init(): any
7-
}
8-
9-
interface PlayerModuleBrightcoveInterface {
10-
VERSION: any
11-
PlayerChangeLoadFlg: boolean
12-
CONFIG: {
13-
mode: string
14-
id : string
15-
16-
player_id: string
17-
player_id_wrap: string
18-
player_ui_id: string
19-
player_style_id: string
20-
21-
videoid: string | number
22-
account: string | number
23-
width: string | number
24-
height: string | number
25-
26-
player: string | number
27-
volume: number
28-
29-
playsinline: string
30-
loop: string
31-
muted: string // '' | 'muted'
32-
33-
ui_controls: string
34-
ui_autoplay: string
35-
ui_default: boolean
36-
ui_default_css: boolean
37-
38-
stop_outfocus: boolean
39-
poster: boolean
40-
41-
add_style: string
42-
classname_active_wrap: string
43-
classname_active: string
44-
}
45-
PlayerMediaInfo: any
46-
Player: any
47-
$: {
48-
playerElem : any
49-
playerElemMain : any
50-
playerElemMainWrap : any
51-
uiBtnPlay : any
52-
uiBtnStop : any
53-
uiBtnPause : any
54-
uiBtnMute : any
55-
uiBtnVolon : any
56-
uiBtnVoloff : any
57-
uiDisplayTime : any
58-
uiDisplayTimeNow : any
59-
uiDisplayTimeTotal : any
60-
uiDisplayTimeDown : any
61-
uiDisplayTimePar : any
62-
uiDisplayPoster : any
63-
uiDisplayPosterBg : any
64-
uiDisplayName : any
65-
uiSeekbarVol : any
66-
uiSeekbarVolBg : any
67-
uiSeekbarVolCover : any
68-
uiSeekbarTime : any
69-
uiSeekbarTimeBg : any
70-
uiSeekbarTimeCover : any
71-
uiBtnChange : any
72-
uiBtnDataId : any
73-
}
74-
playerHtml: any
75-
playerCss: any
76-
playerScriptCode: any
77-
playerUiHtml: string
78-
playerCssOption: string
79-
on: any
80-
PlayerJson?: any
81-
PlayerChangeSeekingFlg: boolean
82-
83-
state: {
84-
poster: string
85-
}
86-
}
4+
declare module '@yama-dev/js-parse-module/dist/js-parse-module';
875

88-
declare function videojs(id: string): void
6+
declare function videojs(id: string): void;
897

908
interface Window {
919
PLAYER_MODULE_ALL_PLATLIST: any

dist/js-player-module-brightcove.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "js-player-module-brightcove",
3-
"version": "6.1.0",
3+
"version": "6.1.2",
44
"description": "Brightcove custom player using the Brightcove Player API.",
55
"keywords": [
66
"Brightcove",
@@ -19,7 +19,7 @@
1919
"dev": "npm-run-all -p webpack:develop server",
2020
"prod": "npm-run-all -p webpack:build",
2121
"server": "browser-sync start --server ./ --directory ./examples --files **/*.css **/*.js **/*.html",
22-
"webpack:develop": "webpack --progress --color --watch",
22+
"webpack:develop": "webpack --progress --color --watch --stats-error-details",
2323
"webpack:build": "webpack --mode=production --progress --color"
2424
},
2525
"repository": {
@@ -35,8 +35,8 @@
3535
"npm-run-all": "^4.1.5",
3636
"ts-loader": "^9.2.3",
3737
"typescript": "^4.3.5",
38-
"webpack": "^5.44.0",
39-
"webpack-cli": "^4.7.2"
38+
"webpack": "^5.58.0",
39+
"webpack-cli": "^4.9.0"
4040
},
4141
"dependencies": {
4242
"@yama-dev/js-dom": "^0.1.1",

src/common.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export declare let viewPlayerScriptcode: string;

src/js-player-module-brightcove.d.ts

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
export declare class PLAYER_MODULE_BRIGHTCOVE {
2+
VERSION: string;
3+
PlayerChangeLoadFlg: boolean;
4+
CONFIG: {
5+
mode: string;
6+
id: string;
7+
player_id: string;
8+
player_id_wrap: string;
9+
player_ui_id: string;
10+
player_style_id: string;
11+
videoid: string;
12+
account: string;
13+
width: string;
14+
height: string;
15+
player: string;
16+
volume: number;
17+
playsinline: string;
18+
loop: string;
19+
muted: string;
20+
ui_controls: string;
21+
ui_autoplay: string;
22+
ui_default: boolean;
23+
ui_default_css: boolean;
24+
stop_outfocus: boolean;
25+
poster: boolean;
26+
add_style: string;
27+
classname_active_wrap: string;
28+
classname_active: string;
29+
};
30+
on: {
31+
PlayerInit: any;
32+
PlayerEnded: any;
33+
PlayerPlay: any;
34+
PlayerPause: any;
35+
TimeUpdate: any;
36+
VolumeChange: any;
37+
PlayPrep: any;
38+
Play: any;
39+
Pause: any;
40+
Stop: any;
41+
PauseAll: any;
42+
StopAll: any;
43+
Change: any;
44+
};
45+
PlayerMediaInfo: {};
46+
Player: any;
47+
$: {
48+
playerElem: any[];
49+
playerElemMainWrap: any[];
50+
uiBtnPlay: any[];
51+
uiBtnStop: any[];
52+
uiBtnPause: any[];
53+
uiBtnMute: any[];
54+
uiBtnVolon: any[];
55+
uiBtnVoloff: any[];
56+
uiDisplayTime: any[];
57+
uiDisplayTimeNow: any[];
58+
uiDisplayTimeTotal: any[];
59+
uiDisplayTimeDown: any[];
60+
uiDisplayTimePar: any[];
61+
uiDisplayPoster: any[];
62+
uiDisplayPosterBg: any[];
63+
uiDisplayName: any[];
64+
uiSeekbarVol: any[];
65+
uiSeekbarVolBg: any[];
66+
uiSeekbarVolCover: any[];
67+
uiSeekbarTime: any[];
68+
uiSeekbarTimeBg: any[];
69+
uiSeekbarTimeCover: any[];
70+
uiBtnChange: any[];
71+
uiBtnDataId: any[];
72+
};
73+
playerHtml: string;
74+
playerUiHtml: string;
75+
playerCss: string;
76+
playerCssOption: string;
77+
playerScriptCode: string;
78+
PlayerJson: {};
79+
PlayerChangeSeekingFlg: boolean;
80+
state: {
81+
poster: string;
82+
};
83+
constructor(options: any);
84+
private BuildPlayer;
85+
PlayerInstance(): void;
86+
AddGlobalObject(): void;
87+
CacheElement(): void;
88+
EventPlay(): void;
89+
EventPause(): void;
90+
EventStop(): void;
91+
EventMute(): void;
92+
EventVolon(): void;
93+
EventVoloff(): void;
94+
/**
95+
* When dragging a seek bar(volume).
96+
*/
97+
EventSeekbarVol(): void;
98+
/**
99+
* When dragging a seek bar(time).
100+
*/
101+
EventSeekbarTime(): void;
102+
EventChangeVideo(): void;
103+
ClassOn(): void;
104+
ClassOff(): void;
105+
Update(): void;
106+
Play(callback?: () => {}): void;
107+
Stop(callback?: () => {}): void;
108+
Pause(callback?: () => {}): void;
109+
Mute(): void;
110+
/**
111+
* When Media change.
112+
*
113+
* id | str | media-id.
114+
* isplay | boolean | auto start after changed media.
115+
* callback | function | callback function after changed media.
116+
*/
117+
Change(id: any, isplay?: boolean, callback?: () => {}): void;
118+
PauseAll(callback?: () => {}): void;
119+
StopAll(callback?: () => {}): void;
120+
SeekTo(sec: any): boolean;
121+
GetTime(): string;
122+
GetTimeDown(): string;
123+
GetTimeMax(): string;
124+
GetTimeRatio(): number;
125+
GetTimePar(): string;
126+
GetPoster(): any;
127+
GetMediaInfo(): any;
128+
SetVolume(vol?: number | 'off'): boolean;
129+
Destroy(): void;
130+
private _setPoster;
131+
private _setInfo;
132+
static parseNumber(num: number | string): string;
133+
static pad(n: number | string, width: number, z: string): string;
134+
static toFixedNumber(num: number | string, digits: number, base?: number): number;
135+
}

src/js-player-module-brightcove.ts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
/*eslint no-console: 0*/
33
/*eslint no-useless-escape: 0*/
44

5-
// @ts-ignore
6-
import * as DOM from '@yama-dev/js-dom/core';
5+
import * as JS_DOM from '@yama-dev/js-dom';
6+
const DOM = new JS_DOM();
77

8-
// @ts-ignore
98
import {
10-
Str2Mustache
11-
} from '@yama-dev/js-parse-module/libs';
9+
PARSE_MODULE
10+
} from '@yama-dev/js-parse-module/dist/js-parse-module';
11+
const Str2Mustache = PARSE_MODULE.Str2Mustache;
1212

1313
import {
1414
viewPlayerScriptcode,
@@ -23,7 +23,7 @@ import {
2323
viewPlayerStyle
2424
} from './view-style';
2525

26-
export class PLAYER_MODULE_BRIGHTCOVE implements PlayerModuleBrightcoveInterface {
26+
export class PLAYER_MODULE_BRIGHTCOVE {
2727
// Set Version.
2828
VERSION = process.env.VERSION;
2929

@@ -87,12 +87,11 @@ export class PLAYER_MODULE_BRIGHTCOVE implements PlayerModuleBrightcoveInterface
8787
PlayerMediaInfo = {};
8888

8989
// BrightcovePlayer Instance.
90-
Player;
90+
Player = null;
9191

9292
// BrightcovePlayer dom.
9393
$ = {
9494
playerElem : [],
95-
playerElemMain : [],
9695
playerElemMainWrap : [],
9796
uiBtnPlay : [],
9897
uiBtnStop : [],
@@ -231,12 +230,9 @@ export class PLAYER_MODULE_BRIGHTCOVE implements PlayerModuleBrightcoveInterface
231230
}
232231

233232
// Player Main.
234-
let playerHtmlDom = document.createElement('div');
235233
let playerHtmlDomWrap = document.createElement('div');
236-
playerHtmlDom.id = this.CONFIG.player_id;
237234
playerHtmlDomWrap.id = this.CONFIG.player_id_wrap;
238-
playerHtmlDom.innerHTML = this.playerHtml;
239-
playerHtmlDomWrap.appendChild(playerHtmlDom);
235+
playerHtmlDomWrap.innerHTML = this.playerHtml;
240236
this.$.playerElem[0].insertBefore(playerHtmlDomWrap, this.$.playerElem[0].firstElementChild);
241237

242238
// Player Style.
@@ -382,7 +378,6 @@ export class PLAYER_MODULE_BRIGHTCOVE implements PlayerModuleBrightcoveInterface
382378

383379
CacheElement(){
384380
this.$.playerElem = DOM.selectDom(`#${this.CONFIG.id}`);
385-
this.$.playerElemMain = DOM.selectDom(`#${this.CONFIG.id} #${this.CONFIG.player_id}`);
386381
this.$.playerElemMainWrap = DOM.selectDom(`#${this.CONFIG.id} #${this.CONFIG.player_id_wrap}`);
387382

388383
this.$.uiBtnPlay = DOM.selectDom('#'+this.CONFIG.id+' .ui-btn-play');

src/view-dom.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export declare let viewPlayerMain: string;
2+
export declare let viewPlayerUi: string;

src/view-style.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export declare let viewPlayerStyle: string;

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
"sourceMap": true,
1313

14+
"declaration": true,
1415
"strict": true,
1516
"noImplicitAny": false,
1617
"strictNullChecks": false,

0 commit comments

Comments
 (0)