Skip to content

Commit

Permalink
Merge pull request #47 from niyuancheng/dev
Browse files Browse the repository at this point in the history
V1.3.5
  • Loading branch information
niyuancheng authored Apr 4, 2023
2 parents fde4e7e + cb43fb5 commit fd4386d
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "niplayer",
"version": "1.3.4",
"version": "1.3.5",
"description": "This is a TS library for video player",
"main": "./dist/player.esm.js",
"types": "./dist/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions src/class/Component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ export class Component extends BaseEvent {
initMobileTemplate() {}
initComponent() {}
resetEvent() {}
// 销毁组件
dispose() {}
}
2 changes: 1 addition & 1 deletion src/component/ToolBar/BottomBar/parts/Options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
checkIsMouseInRange,
includeClass,
removeClass,
} from "../../../../utils/domUtils";
} from "@/utils/domUtils";

export class Options extends Component implements ComponentItem {
id = "Options";
Expand Down
2 changes: 0 additions & 2 deletions src/mp4/Mp4Parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,4 @@ export class Mp4Parser {

this.downloader.start();
}


}
19 changes: 16 additions & 3 deletions src/page/player.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
ComponentConstructor,
ComponentItem,
DanmakuController,
DOMProps,
Expand Down Expand Up @@ -44,6 +45,7 @@ class Player extends Component implements ComponentItem {
private videoInfo: Video;
enableSeek = true;
env = Env.env;
// 保存当前运行环境的全屏模式,主要用于移动端-- 竖版全屏和横板全屏
fullScreenMode: "Vertical" | "Horizontal" = "Horizontal";
video: HTMLVideoElement;
container: HTMLElement;
Expand Down Expand Up @@ -581,16 +583,27 @@ class Player extends Component implements ComponentItem {
this.contextMenu.registerContextMenu(content,click);
}

// 注册一个底部的Controller类型的组件
registerControllers(component: ComponentConstructor, pos: "left" | "medium" | "right") {
if(pos === "left") {
if(!this.playerOptions.leftBottomBarControllers) this.playerOptions.leftBottomBarControllers = [];
this.playerOptions.leftBottomBarControllers.push(component);
}else if(pos === "medium") {
if(!this.playerOptions.mediumMediumBarController) this.playerOptions.mediumMediumBarController = [];
this.playerOptions.mediumMediumBarController.push(component);
}else {
if(!this.playerOptions.rightBottomBarControllers) this.playerOptions.rightBottomBarControllers = [];
this.playerOptions.rightBottomBarControllers.push(component);
}
}

// 注册一个设置选项
registerSubsetting() {}

// 获取视频信息
getVideoInfo(): Video {
return this.videoInfo;
}



// 设置视频信息
setVideoInfo(info:Video): void {
this.videoInfo = info;
Expand Down

0 comments on commit fd4386d

Please sign in to comment.