easy-player-pro 0.1.5 → 0.1.7
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/lib/build/EasyPlayer-decode.js +1 -0
- package/lib/build/EasyPlayer-lib.js +1 -0
- package/lib/build/EasyPlayer-pro.js +1 -0
- package/lib/build/EasyPlayer-pro.wasm +0 -0
- package/lib/build/EasyPlayer-snap.wasm +0 -0
- package/lib/build/adapter-7.4.0.min.js +1 -0
- package/lib/build/srs.page.js +182 -0
- package/lib/build/srs.sdk.js +681 -0
- package/lib/build/winlin.utility.js +686 -0
- package/lib/core/easy-player-pro.js +15 -10
- package/lib/css/index.css +4 -0
- package/lib/img/icon-play.svg +1 -0
- package/lib/index.js +1 -0
- package/lib/types/core/easy-player-pro.d.ts +1 -1
- package/lib/types/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -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', () =>
|
|
124
|
-
|
|
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));
|
|
@@ -151,7 +157,7 @@ export class EasyPlayerPro {
|
|
|
151
157
|
return new Promise((resolve, reject) => {
|
|
152
158
|
try {
|
|
153
159
|
if (this.player) {
|
|
154
|
-
if (this.
|
|
160
|
+
if (this._isRtcSRS()) {
|
|
155
161
|
this.player.$container.querySelector('.easyplayer-loading').style.display = 'flex';
|
|
156
162
|
this.player.player._opt.url = url;
|
|
157
163
|
if (this.videoElement) {
|
|
@@ -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);
|
|
@@ -250,7 +255,7 @@ export class EasyPlayerPro {
|
|
|
250
255
|
*/
|
|
251
256
|
pause() {
|
|
252
257
|
if (this.player) {
|
|
253
|
-
if (this.
|
|
258
|
+
if (this._isRtcSRS()) {
|
|
254
259
|
this.videoElement.pause();
|
|
255
260
|
this.player.$container.querySelector('.easyplayer-controls-item.easyplayer-play').style.display = 'flex';
|
|
256
261
|
this.player.$container.querySelector('.easyplayer-controls-item.easyplayer-pause').style.display = 'none';
|
|
@@ -265,7 +270,7 @@ export class EasyPlayerPro {
|
|
|
265
270
|
*/
|
|
266
271
|
isPause() {
|
|
267
272
|
if (this.player) {
|
|
268
|
-
if (this.
|
|
273
|
+
if (this._isRtcSRS()) {
|
|
269
274
|
return this.videoElement.paused;
|
|
270
275
|
}
|
|
271
276
|
else {
|
|
@@ -282,7 +287,7 @@ export class EasyPlayerPro {
|
|
|
282
287
|
*/
|
|
283
288
|
setMute(isMute) {
|
|
284
289
|
if (this.player) {
|
|
285
|
-
if (this.
|
|
290
|
+
if (this._isRtcSRS()) {
|
|
286
291
|
this.videoElement.muted = isMute;
|
|
287
292
|
this.player.$container.querySelector('.easyplayer-icon-audio').style.display = isMute ? 'none' : 'flex';
|
|
288
293
|
this.player.$container.querySelector('.easyplayer-icon-mute').style.display = isMute ? 'flex' : 'none';
|
|
@@ -297,7 +302,7 @@ export class EasyPlayerPro {
|
|
|
297
302
|
*/
|
|
298
303
|
isMute() {
|
|
299
304
|
if (this.player) {
|
|
300
|
-
if (this.
|
|
305
|
+
if (this._isRtcSRS()) {
|
|
301
306
|
return this.videoElement.muted;
|
|
302
307
|
}
|
|
303
308
|
else {
|
|
@@ -379,7 +384,7 @@ export class EasyPlayerPro {
|
|
|
379
384
|
/**
|
|
380
385
|
* 判断是否为SRS直播源
|
|
381
386
|
*/
|
|
382
|
-
|
|
387
|
+
_isRtcSRS() {
|
|
383
388
|
return this.config.isRtcSRS || (this._url.indexOf('/rtc/v1/whep') > -1);
|
|
384
389
|
}
|
|
385
390
|
/**
|
|
@@ -387,7 +392,7 @@ export class EasyPlayerPro {
|
|
|
387
392
|
*/
|
|
388
393
|
destroy() {
|
|
389
394
|
if (this.player) {
|
|
390
|
-
if (this.
|
|
395
|
+
if (this._isRtcSRS()) {
|
|
391
396
|
this.controller.abort();
|
|
392
397
|
}
|
|
393
398
|
this.player.destroy();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="#fff" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M6.906 4.537A.6.6 0 0 0 6 5.053v13.894a.6.6 0 0 0 .906.516l11.723-6.947a.6.6 0 0 0 0-1.032z"/></svg>
|
package/lib/index.js
CHANGED
package/lib/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easy-player-pro",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
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"
|