easy-player-pro 0.1.6 → 0.1.8

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.
@@ -120,8 +120,14 @@ export class EasyPlayerPro {
120
120
  this.isDestroy = false;
121
121
  this.controller = new AbortController();
122
122
  this.signal = this.controller.signal;
123
- this.player.on('play', () => this.onPlay());
124
- this.player.on('pause', () => this.onPause());
123
+ this.player.on('play', () => {
124
+ this.player.$container.querySelector('.easyplayer-controls-code-wrap').style.display = 'none';
125
+ this.onPlay();
126
+ });
127
+ this.player.on('pause', () => {
128
+ this.player.$container.querySelector('.easyplayer-controls-code-wrap').style.display = 'none';
129
+ this.onPause();
130
+ });
125
131
  this.player.on('videoInfo', (videoInfo) => this.onVideoInfo(videoInfo));
126
132
  this.player.on('audioInfo', (audioInfo) => this.onAudioInfo(audioInfo));
127
133
  this.player.on('fullscreen', (isFullscreen) => this.onFullscreen(isFullscreen));
@@ -182,7 +188,6 @@ export class EasyPlayerPro {
182
188
  else {
183
189
  this.player.play(url).then(() => {
184
190
  setTimeout(() => {
185
- this.player.$container.querySelector('.easyplayer-controls-code-wrap').style.display = 'none';
186
191
  resolve();
187
192
  }, 300);
188
193
  }).catch(reject);
@@ -1,11 +1,11 @@
1
1
  import { type EasyPlayerProConfig } from "./config";
2
- export type VideoInfo = {
2
+ export type VideoInfoType = {
3
3
  encType: string;
4
4
  encTypeCode: number;
5
5
  height: number;
6
6
  width: number;
7
7
  };
8
- export type AudioInfo = {
8
+ export type AudioInfoType = {
9
9
  encTypeCode: string;
10
10
  encType: string;
11
11
  channels: number;
@@ -34,11 +34,11 @@ export declare class EasyPlayerPro {
34
34
  /**
35
35
  * 视频信息回调
36
36
  */
37
- onVideoInfo: (videoInfo: VideoInfo) => void;
37
+ onVideoInfo: (videoInfo: VideoInfoType) => void;
38
38
  /**
39
39
  * 音频信息回调
40
40
  */
41
- onAudioInfo: (audioInfo: AudioInfo) => void;
41
+ onAudioInfo: (audioInfo: AudioInfoType) => void;
42
42
  /**
43
43
  * 全屏事件
44
44
  */
@@ -170,11 +170,11 @@ export declare class EasyPlayerPro {
170
170
  /**
171
171
  * 获取视频信息
172
172
  */
173
- getVideoInfo(): VideoInfo | null;
173
+ getVideoInfo(): VideoInfoType | null;
174
174
  /**
175
175
  * 获取音频信息
176
176
  */
177
- getAudioInfo(): AudioInfo | null;
177
+ getAudioInfo(): AudioInfoType | null;
178
178
  /**
179
179
  * 设置语音对讲状态(PTZ需开启)
180
180
  * @param isMic
@@ -189,3 +189,42 @@ export declare class EasyPlayerPro {
189
189
  */
190
190
  destroy(): void;
191
191
  }
192
+ export interface EasyPlayerProType {
193
+ isDestroy: boolean;
194
+ onPlay: () => void;
195
+ onPause: () => void;
196
+ onVideoInfo: (videoInfo: VideoInfoType) => void;
197
+ onAudioInfo: (audioInfo: AudioInfoType) => void;
198
+ onFullscreen: (isFullscreen: boolean) => void;
199
+ onMute: (isMute: boolean) => void;
200
+ onKBps: (KBps: number) => void;
201
+ onStretch: (isStretch: boolean) => void;
202
+ onPTZ: (ptz: any) => void;
203
+ onScreenshots: () => void;
204
+ onContextmenuClose: () => void;
205
+ onDecodeHevc: () => void;
206
+ onLiveEnd: () => void;
207
+ onTimeout: () => void;
208
+ onRecordEnd: () => void;
209
+ onRecordStart: () => void;
210
+ onQualityChange: (quality: string) => void;
211
+ onPlaybackSeek: () => void;
212
+ onPlaybackRate: () => void;
213
+ onTimestamps: () => void;
214
+ onError: (err: any) => void;
215
+ play: (url: string) => Promise<void>;
216
+ pause: () => void;
217
+ isPause: () => boolean;
218
+ setMute: (isMute: boolean) => void;
219
+ isMute: () => boolean | null;
220
+ screenshot: (name?: string, type?: string, rato?: number, format?: string) => string | Blob | null;
221
+ setFullscreen: (isFullscreen: boolean) => void;
222
+ exitFullscreen: () => void;
223
+ setQuality: (quality: string) => void;
224
+ setRate: (rate: number) => void;
225
+ seekTime: (time: number) => void;
226
+ getVideoInfo: () => VideoInfoType | null;
227
+ getAudioInfo: () => AudioInfoType | null;
228
+ setMic: (isMic: boolean) => void;
229
+ destroy: () => void;
230
+ }
@@ -1,6 +1,9 @@
1
1
  import './css/index.css';
2
2
  import * as easyPlayer from './core/easy-player-pro';
3
- export type VideoInfo = easyPlayer.VideoInfo;
4
- export type AudioInfo = easyPlayer.AudioInfo;
3
+ import type { EasyPlayerProConfig } from './core/config';
4
+ export type VideoInfoType = easyPlayer.VideoInfoType;
5
+ export type AudioInfoType = easyPlayer.AudioInfoType;
6
+ export type EasyPlayerProType = easyPlayer.EasyPlayerProType;
7
+ export type EasyPlayerProConfigType = EasyPlayerProConfig;
5
8
  declare const _default: typeof easyPlayer.EasyPlayerPro;
6
9
  export default _default;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "easy-player-pro",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "easy-player-pro 是一款能够同时支持HTTP、HTTP-FLV、HLS(m3u8)、WS、WEBRTC、FMP4视频直播与视频点播等多种协议,支持H.264、H.265、AAC、G711A、Mp3等多种音视频编码格式,支持MSE、WASM、WebCodec等多种解码方式,支持Windows、Linux、Android、iOS全平台终端的H5播放器,使用简单, 功能强大",
5
5
  "type": "module",
6
6
  "module": "./lib/index.js",
7
7
  "scripts": {
8
- "build": "tsc"
8
+ "build": "node build.js && tsc"
9
9
  },
10
10
  "files": [
11
11
  "lib"