mirror of
https://github.com/langyuxiansheng/vue-aliplayer-v2.git
synced 2025-04-06 03:57:55 +08:00
Compare commits
30 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
cdf70ab208 | ||
|
d9bd73f6d4 | ||
|
31441d7773 | ||
|
d7495c1469 | ||
|
444820e168 | ||
|
5169e0cc32 | ||
|
a571705e6a | ||
|
01c82d7f6d | ||
|
5a0a49aacc | ||
|
3758626080 | ||
|
3593da7f8e | ||
|
1b16c2d3e6 | ||
|
39bd7ad3b7 | ||
|
0d7cab7d36 | ||
|
486cfe87bb | ||
|
2d07b16f2e | ||
|
f3b97d319c | ||
|
964f6b847d | ||
|
361f56b518 | ||
|
023de1ad31 | ||
|
d3156070eb | ||
|
6be2ffb5d4 | ||
|
bee90e339b | ||
|
4af7f7fee7 | ||
|
43d7ad5c34 | ||
|
97e9a35fdf | ||
|
91a3b70901 | ||
|
c67573a023 | ||
|
b864b31980 | ||
|
178d0565bd |
583
README.md
583
README.md
@ -1,12 +1,17 @@
|
|||||||
# vue-alipayer-v2
|
# vue-alipayer-v2
|
||||||
## 感谢每一位开源的开发者. 这是一个基于Alipayer 开发并封装成vue组件的播放器.
|
|
||||||
### vue中使用Alipayer,播放rtmp,m3u8,mp4视频
|
## 感谢每一位支持开源的朋友. 这是一个基于 Alipayer 开发并封装成 vue 组件的播放器.
|
||||||
|
|
||||||
|
### vue 中使用 Alipayer,播放 rtmp,m3u8,mp4 视频
|
||||||
|
|
||||||
#### [本项目在线演示](https://langyuxiansheng.github.io/vue-aliplayer-v2/)
|
#### [本项目在线演示](https://langyuxiansheng.github.io/vue-aliplayer-v2/)
|
||||||
|
|
||||||
#### [阿里云播放器在线演示](https://player.alicdn.com/aliplayer/index.html)
|
#### [阿里云播放器在线演示](https://player.alicdn.com/aliplayer/index.html)
|
||||||
|
|
||||||
> 假如此轮子对你有帮助,请顺手star一下吧.o(* ̄︶ ̄*)o
|
> 假如此轮子对你有帮助,请顺手 star 一下吧.o(_ ̄︶ ̄_)o
|
||||||
|
|
||||||
|
## 1.安装使用! 下载安装 npm 包
|
||||||
|
|
||||||
## 1.安装使用! 下载安装npm包
|
|
||||||
```bash
|
```bash
|
||||||
npm i vue-aliplayer-v2 --save
|
npm i vue-aliplayer-v2 --save
|
||||||
or
|
or
|
||||||
@ -16,181 +21,211 @@ yarn add vue-aliplayer-v2
|
|||||||
#### 全局注册 main.js
|
#### 全局注册 main.js
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import VueAliplayerV2 from 'vue-aliplayer-v2';
|
import VueAliplayerV2 from "vue-aliplayer-v2";
|
||||||
|
|
||||||
Vue.use(VueAliplayerV2);
|
Vue.use(VueAliplayerV2);
|
||||||
|
|
||||||
//可选全局配置
|
//可选全局配置
|
||||||
//Vue.use(VueAliplayerV2,{
|
//Vue.use(VueAliplayerV2,{
|
||||||
// cssLink: 'https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css',
|
// cssLink: 'https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css',
|
||||||
// scriptSrc: 'https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js'
|
// scriptSrc: 'https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js'
|
||||||
//});
|
//});
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 局部注册 App.vue
|
#### 局部注册 App.vue
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
|
|
||||||
//推荐第一种(仅v1.2.3)及以上的版本可用
|
//推荐第一种(仅v1.2.3)及以上的版本可用
|
||||||
import VueAliplayerV2 from 'vue-aliplayer-v2';
|
import VueAliplayerV2 from "vue-aliplayer-v2";
|
||||||
components:{ VueAliplayerV2 }
|
components: {
|
||||||
|
VueAliplayerV2;
|
||||||
|
}
|
||||||
|
|
||||||
//或者
|
//或者
|
||||||
components:{ VueAliplayerV2: VueAliplayerV2.Player }
|
components: {
|
||||||
|
VueAliplayerV2: VueAliplayerV2.Player;
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## 2.组件中使用
|
## 2.组件中使用
|
||||||
|
|
||||||
### 组件模板使用,下面的视频连接仅供演示测试.
|
### 组件模板使用,下面的视频连接仅供演示测试.
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<template>
|
<template>
|
||||||
<div id="app">
|
<div id="app">
|
||||||
<template v-if="!isShowMultiple && show">
|
<template v-if="!isShowMultiple && show">
|
||||||
<vue-aliplayer-v2 :source="source" ref="VueAliplayerV2" :options="options" />
|
<vue-aliplayer-v2
|
||||||
</template>
|
:source="source"
|
||||||
<div v-if="isShowMultiple && show" class="show-multiple">
|
ref="VueAliplayerV2"
|
||||||
<template v-for="x in 5">
|
:options="options"
|
||||||
<vue-aliplayer-v2 class="multiple-player" :key="x" :source="source" ref="VueAliplayerV2" :options="options" />
|
/>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
<div v-if="isShowMultiple && show" class="show-multiple">
|
||||||
<p class="remove-text" v-if="!show">播放器已销毁!</p>
|
<template v-for="x in 5">
|
||||||
<div class="player-btns">
|
<vue-aliplayer-v2
|
||||||
<template v-if="!isShowMultiple && show">
|
class="multiple-player"
|
||||||
<span @click="play()">播放</span>
|
:key="x"
|
||||||
<span @click="pause()">暂停</span>
|
:source="source"
|
||||||
<span @click="replay()">重播</span>
|
ref="VueAliplayerV2"
|
||||||
<span @click="getCurrentTime()">播放时刻</span>
|
:options="options"
|
||||||
<span @click="getStatus()">获取播放器状态</span>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<span @click="show = !show">{{ show ? '销毁' : '重载' }}</span>
|
|
||||||
<span @click="options.isLive = !options.isLive">{{ options.isLive ? '切换普通模式' : '切换直播模式' }}</span>
|
|
||||||
<span @click="showMultiple()">{{isShowMultiple ? '显示1个播放器' : '显示多个播放器'}}</span>
|
|
||||||
</div>
|
|
||||||
<div class="source-box">
|
|
||||||
<span class="source-label">选择播放源(支持动态切换):</span>
|
|
||||||
<select v-model="source" name="source" id="source">
|
|
||||||
<option value="//player.alicdn.com/video/aliyunmedia.mp4">播放源1</option>
|
|
||||||
<option value="//yunqivedio.alicdn.com/user-upload/nXPDX8AASx.mp4">播放源2</option>
|
|
||||||
<option value="//tbm-auth.alicdn.com/e7qHgLdugbzzKh2eW0J/kXTgBkjvNXcERYxh2PA@@hd_hq.mp4?auth_key=1584519814-0-0-fc98b2738f331ff015f7bf5c62394888">播放源3</option>
|
|
||||||
<option value="//ivi.bupt.edu.cn/hls/cctv1.m3u8">直播播放源4</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="source-box">
|
|
||||||
<span class="source-label">输入播放源(支持动态切换):</span>
|
|
||||||
<input class="source-input" type="text" v-model="source">
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<p class="remove-text" v-if="!show">播放器已销毁!</p>
|
||||||
|
<div class="player-btns">
|
||||||
|
<template v-if="!isShowMultiple && show">
|
||||||
|
<span @click="play()">播放</span>
|
||||||
|
<span @click="pause()">暂停</span>
|
||||||
|
<span @click="replay()">重播</span>
|
||||||
|
<span @click="getCurrentTime()">播放时刻</span>
|
||||||
|
<span @click="getStatus()">获取播放器状态</span>
|
||||||
|
</template>
|
||||||
|
<span @click="show = !show">{{ show ? '销毁' : '重载' }}</span>
|
||||||
|
<span @click="options.isLive = !options.isLive"
|
||||||
|
>{{ options.isLive ? '切换普通模式' : '切换直播模式' }}</span
|
||||||
|
>
|
||||||
|
<span @click="showMultiple()"
|
||||||
|
>{{isShowMultiple ? '显示1个播放器' : '显示多个播放器'}}</span
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div class="source-box">
|
||||||
|
<span class="source-label">选择播放源(支持动态切换):</span>
|
||||||
|
<select v-model="source" name="source" id="source">
|
||||||
|
<option value="//player.alicdn.com/video/aliyunmedia.mp4"
|
||||||
|
>播放源1</option
|
||||||
|
>
|
||||||
|
<option value="//yunqivedio.alicdn.com/user-upload/nXPDX8AASx.mp4"
|
||||||
|
>播放源2</option
|
||||||
|
>
|
||||||
|
<option
|
||||||
|
value="//tbm-auth.alicdn.com/e7qHgLdugbzzKh2eW0J/kXTgBkjvNXcERYxh2PA@@hd_hq.mp4?auth_key=1584519814-0-0-fc98b2738f331ff015f7bf5c62394888"
|
||||||
|
>播放源3</option
|
||||||
|
>
|
||||||
|
<option value="//ivi.bupt.edu.cn/hls/cctv1.m3u8">直播播放源4</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="source-box">
|
||||||
|
<span class="source-label">输入播放源(支持动态切换):</span>
|
||||||
|
<input class="source-input" type="text" v-model="source" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data(){
|
data() {
|
||||||
return {
|
return {
|
||||||
options: {
|
options: {
|
||||||
// source:'//player.alicdn.com/video/aliyunmedia.mp4',
|
// source:'//player.alicdn.com/video/aliyunmedia.mp4',
|
||||||
isLive: true, //切换为直播流的时候必填
|
isLive: true, //切换为直播流的时候必填
|
||||||
// format: 'm3u8' //切换为直播流的时候必填
|
// format: 'm3u8' //切换为直播流的时候必填
|
||||||
},
|
},
|
||||||
source: '//player.alicdn.com/video/aliyunmedia.mp4',
|
source: "//player.alicdn.com/video/aliyunmedia.mp4",
|
||||||
// source: '//ivi.bupt.edu.cn/hls/cctv1.m3u8',
|
// source: '//ivi.bupt.edu.cn/hls/cctv1.m3u8',
|
||||||
show: true,
|
show: true,
|
||||||
isShowMultiple: false
|
isShowMultiple: false,
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
methods:{
|
methods: {
|
||||||
|
play() {
|
||||||
|
this.$refs.VueAliplayerV2.play();
|
||||||
|
},
|
||||||
|
|
||||||
play(){
|
pause() {
|
||||||
this.$refs.VueAliplayerV2.play()
|
this.$refs.VueAliplayerV2.pause();
|
||||||
},
|
},
|
||||||
|
|
||||||
pause(){
|
replay() {
|
||||||
this.$refs.VueAliplayerV2.pause();
|
this.$refs.VueAliplayerV2.replay();
|
||||||
},
|
},
|
||||||
|
|
||||||
replay(){
|
getCurrentTime() {
|
||||||
this.$refs.VueAliplayerV2.replay();
|
// this.$refs.VueAliplayerV2.getCurrentTime();
|
||||||
},
|
this.source = "http://ivi.bupt.edu.cn/hls/cctv1.m3u8";
|
||||||
|
},
|
||||||
|
|
||||||
getCurrentTime(){
|
getStatus() {
|
||||||
// this.$refs.VueAliplayerV2.getCurrentTime();
|
const status = this.$refs.VueAliplayerV2.getStatus();
|
||||||
this.source = 'http://ivi.bupt.edu.cn/hls/cctv1.m3u8';
|
console.log(`getStatus:`, status);
|
||||||
},
|
alert(`getStatus:${status}`);
|
||||||
|
},
|
||||||
|
|
||||||
getStatus(){
|
showMultiple() {
|
||||||
const status = this.$refs.VueAliplayerV2.getStatus();
|
this.isShowMultiple = !this.isShowMultiple;
|
||||||
console.log(`getStatus:`, status);
|
},
|
||||||
alert(`getStatus:${status}`);
|
},
|
||||||
},
|
};
|
||||||
|
|
||||||
showMultiple(){
|
|
||||||
this.isShowMultiple = !this.isShowMultiple;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
* {
|
* {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
.remove-text{
|
.remove-text {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
}
|
}
|
||||||
.show-multiple{
|
.show-multiple {
|
||||||
display: flex;
|
display: flex;
|
||||||
.multiple-player{
|
.multiple-player {
|
||||||
width: calc(100% / 4);
|
width: calc(100% / 4);
|
||||||
margin: 20px;
|
margin: 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.player-btns{
|
.player-btns {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
span {
|
span {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 5px 10px;
|
padding: 5px 10px;
|
||||||
width: 150px;
|
width: 150px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
border: 1px solid #eee;
|
border: 1px solid #eee;
|
||||||
background: #e1e1e1;
|
background: #e1e1e1;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.source-box{
|
.source-box {
|
||||||
padding: 5px 10px;
|
padding: 5px 10px;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
.source-label{
|
.source-label {
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
#source{
|
#source {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
.source-input{
|
.source-input {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
padding: 5px 10px;
|
padding: 5px 10px;
|
||||||
width: 80%;
|
width: 80%;
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## 3.功能与配置
|
## 3.功能与配置
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
props:{
|
props:{
|
||||||
|
|
||||||
|
forbidFastForward: { //禁止拖拽快进
|
||||||
|
required: false,
|
||||||
|
type: [Boolean],
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
|
||||||
options: { //配置项 (options.source 不支持动态切换,需要动态切换请直接使用source)
|
options: { //配置项 (options.source 不支持动态切换,需要动态切换请直接使用source)
|
||||||
required: false,
|
required: false,
|
||||||
type: [Object],
|
type: [Object],
|
||||||
@ -206,166 +241,173 @@ props:{
|
|||||||
cssLink:{ //css版本源
|
cssLink:{ //css版本源
|
||||||
required: false,
|
required: false,
|
||||||
type: [String],
|
type: [String],
|
||||||
default: `https://g.alicdn.com/de/prismplayer/2.9.0/skins/default/aliplayer-min.css`
|
default: `https://g.alicdn.com/de/prismplayer/2.9.7/skins/default/aliplayer-min.css`
|
||||||
},
|
},
|
||||||
scriptSrc:{ //js版本源
|
scriptSrc:{ //js版本源
|
||||||
required: false,
|
required: false,
|
||||||
type: [String],
|
type: [String],
|
||||||
default: `https://g.alicdn.com/de/prismplayer/2.9.0/aliplayer-min.js`
|
default: `https://g.alicdn.com/de/prismplayer/2.9.7/aliplayer-min.js`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3.1 配置项 options 属性
|
### 3.1 配置项 options 属性
|
||||||
|
|
||||||
可以参考 [属性和接口说明](https://help.aliyun.com/document_detail/125572.html?spm=a2c4g.11186623.6.1085.36fc6fc57WKZ5P)
|
可以参考 [属性和接口说明](https://help.aliyun.com/document_detail/125572.html?spm=a2c4g.11186623.6.1085.36fc6fc57WKZ5P)
|
||||||
|
|
||||||
| 名称 | 类型 | 说明 |
|
| 名称 | 类型 | 说明 |
|
||||||
| :- | :-: | :- |
|
| :----------------------- | :-----------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| source | String | 视频播放地址url:单独url。默认状态,表示使用vid+playauth。source播放方式优先级最高。source支持多清晰度设置:source:’{“HD”:”address1”,”SD”:”address2”’,详情参见多清晰度播放。 |
|
| source | String | 视频播放地址 url:单独 url。默认状态,表示使用 vid+playauth。source 播放方式优先级最高。source 支持多清晰度设置:source:’{“HD”:”address1”,”SD”:”address2”’,详情参见多清晰度播放。 |
|
||||||
| vid | String | 媒体转码服务的媒体Id。 |
|
| vid | String | 媒体转码服务的媒体 Id。 |
|
||||||
| playauth | String | 播放权证,如何得到参见获取playauth。 |
|
| playauth | String | 播放权证,如何得到参见获取 playauth。 |
|
||||||
| height | String | 播放器高度,可形如‘100%’或者‘100px’,chrome浏览器下flash播放器分别不能小于397x297。 |
|
| height | String | 播放器高度,可形如‘100%’或者‘100px’,chrome 浏览器下 flash 播放器分别不能小于 397x297。 |
|
||||||
| width | String | 播放器宽度,可形如‘100%’或者‘100px’,chrome浏览器下flash播放器分别不能小于397x297。 |
|
| width | String | 播放器宽度,可形如‘100%’或者‘100px’,chrome 浏览器下 flash 播放器分别不能小于 397x297。 |
|
||||||
| videoWidth | String | 视频宽度,仅h5支持。详情参见旋转和镜像。 |
|
| videoWidth | String | 视频宽度,仅 h5 支持。详情参见旋转和镜像。 |
|
||||||
| videoHeight | String | 视频高度,仅h5支持。详情参见旋转和镜像。 |
|
| videoHeight | String | 视频高度,仅 h5 支持。详情参见旋转和镜像。 |
|
||||||
| preload | Boolean | 播放器自动加载,目前仅h5可用。 |
|
| preload | Boolean | 播放器自动加载,目前仅 h5 可用。 |
|
||||||
| cover | String | 播放器默认封面图片,请填写正确的图片url地址。需要autoplay为’false’时,才生效。Flash播放器封面也需要开启允许跨域访问。 |
|
| cover | String | 播放器默认封面图片,请填写正确的图片 url 地址。需要 autoplay 为’false’时,才生效。Flash 播放器封面也需要开启允许跨域访问。 |
|
||||||
| isLive | Boolean | 播放内容是否为直播,直播时会禁止用户拖动进度条。 |
|
| isLive | Boolean | 播放内容是否为直播,直播时会禁止用户拖动进度条。 |
|
||||||
| autoplay | Boolean | 播放器是否自动播放,在移动端autoplay属性会失效。Safari11不会自动开启自动播放如何开启。 |
|
| autoplay | Boolean | 播放器是否自动播放,在移动端 autoplay 属性会失效。Safari11 不会自动开启自动播放如何开启。 |
|
||||||
| rePlay | Boolean | 播放器自动循环播放。 |
|
| rePlay | Boolean | 播放器自动循环播放。 |
|
||||||
| useH5Prism | Boolean | 指定使用H5播放器。 |
|
| useH5Prism | Boolean | 指定使用 H5 播放器。 |
|
||||||
| useFlashPrism | Boolean | 指定使用Flash播放器。 |
|
| useFlashPrism | Boolean | 指定使用 Flash 播放器。 |
|
||||||
| playsinline | Boolean | H5是否内置播放,有的Android浏览器不起作用。 |
|
| playsinline | Boolean | H5 是否内置播放,有的 Android 浏览器不起作用。 |
|
||||||
| showBuffer | Boolean | 显示播放时缓冲图标,默认true。 |
|
| showBuffer | Boolean | 显示播放时缓冲图标,默认 true。 |
|
||||||
| skinRes | Url | 说明:皮肤图片,不建议随意修改该字段,如要修改,请参照皮肤定制。 |
|
| skinRes | Url | 说明:皮肤图片,不建议随意修改该字段,如要修改,请参照皮肤定制。 |
|
||||||
| skinLayout | Array Boolean | 说明:功能组件布局配置,不传该字段使用默认布局。传false隐藏所有功能组件,请参照皮肤定制。 |
|
| skinLayout | Array Boolean | 说明:功能组件布局配置,不传该字段使用默认布局。传 false 隐藏所有功能组件,请参照皮肤定制。 |
|
||||||
| controlBarVisibility | String | 控制面板的实现,默认为‘hover’。可选的值为:‘click’、‘hover’、‘always’。 |
|
| controlBarVisibility | String | 控制面板的实现,默认为‘hover’。可选的值为:‘click’、‘hover’、‘always’。 |
|
||||||
| showBarTime | String | 控制栏自动隐藏时间(ms)。 |
|
| showBarTime | String | 控制栏自动隐藏时间(ms)。 |
|
||||||
| extraInfo | String | 说明:JSON串用于定制性接口参数。|
|
| extraInfo | String | 说明:JSON 串用于定制性接口参数。 |
|
||||||
| > | > | 1.“fullTitle”:“测试页面”全屏时显示视频标题(仅flash支持)。|
|
| > | > | 1.“fullTitle”:“测试页面”全屏时显示视频标题(仅 flash 支持)。 |
|
||||||
| > | > | 2. “m3u8BufferLength”:“30”播放m3u8时加载缓存ts文件长度单位(秒)(仅flash支持)。|
|
| > | > | 2. “m3u8BufferLength”:“30”播放 m3u8 时加载缓存 ts 文件长度单位(秒)(仅 flash 支持)。 |
|
||||||
| > | > | 3. “liveStartTime”:“2016/08/17 12:00:00”,直播开始时间,用于提示直播未开始(仅flash支持)。|
|
| > | > | 3. “liveStartTime”:“2016/08/17 12:00:00”,直播开始时间,用于提示直播未开始(仅 flash 支持)。 |
|
||||||
| > | > | 4. “liveOverTime”:“2016/08/17 14:00:00”,直播结束时间,用于提示直播结束(仅flash支持)。|
|
| > | > | 4. “liveOverTime”:“2016/08/17 14:00:00”,直播结束时间,用于提示直播结束(仅 flash 支持)。 |
|
||||||
| enableSystemMenu | Boolean | 是否允许系统右键菜单显示,默认为false。 |
|
| enableSystemMenu | Boolean | 是否允许系统右键菜单显示,默认为 false。 |
|
||||||
| format | String | 指定播放地址格式,只有使用vid的播放方式时支持,可选值为’mp4’、’m3u8’、’flv’、’mp3’,默认为空,仅H5支持。 |
|
| format | String | 指定播放地址格式,只有使用 vid 的播放方式时支持,可选值为’mp4’、’m3u8’、’flv’、’mp3’,默认为空,仅 H5 支持。 |
|
||||||
| mediaType | String | 指定返回音频还是视频,只有使用vid的播放方式时支持。可选值为’video’和’audio’,默认为’video’,‘audio’主要是针对只包含音频的视频格式,比如音频的mp4,仅H5支持。 |
|
| mediaType | String | 指定返回音频还是视频,只有使用 vid 的播放方式时支持。可选值为’video’和’audio’,默认为’video’,‘audio’主要是针对只包含音频的视频格式,比如音频的 mp4,仅 H5 支持。 |
|
||||||
| qualitySort | String | 指定排序方式,只有使用vid + plauth播放方式时支持。‘desc’表示按倒序排序(即:从大到小排序),‘asc’表示按正序排序(即:从小到大排序),默认值:‘asc’,仅H5支持。 |
|
| qualitySort | String | 指定排序方式,只有使用 vid + plauth 播放方式时支持。‘desc’表示按倒序排序(即:从大到小排序),‘asc’表示按正序排序(即:从小到大排序),默认值:‘asc’,仅 H5 支持。 |
|
||||||
| definition | String | 显示视频清晰度,多个用逗号分隔,比如:’FD,LD’,此值是vid对应流清晰度的一个子集,取值范围:FD(流畅)LD(标清)SD(高清)HD(超清)OD(原画)2K(2K)4K(4K),仅H5支持。 |
|
| definition | String | 显示视频清晰度,多个用逗号分隔,比如:’FD,LD’,此值是 vid 对应流清晰度的一个子集,取值范围:FD(流畅)LD(标清)SD(高清)HD(超清)OD(原画)2K(2K)4K(4K),仅 H5 支持。 |
|
||||||
| defaultDefinition | String | 默认视频清晰度,此值是vid对应流的一个清晰度,取值范围:FD(流畅)LD(标清)SD(高清)HD(超清)OD(原画)2K(2K)4K(4K),仅H5支持。|
|
| defaultDefinition | String | 默认视频清晰度,此值是 vid 对应流的一个清晰度,取值范围:FD(流畅)LD(标清)SD(高清)HD(超清)OD(原画)2K(2K)4K(4K),仅 H5 支持。 |
|
||||||
| x5_type | String | 声明启用同层H5播放器,启用时设置的值为‘h5’,详情参见同层播放。 |
|
| x5_type | String | 声明启用同层 H5 播放器,启用时设置的值为‘h5’,详情参见同层播放。 |
|
||||||
| x5_fullscreen | Boolean | 声明视频播放时是否进入到TBS的全屏模式,默认为false。当需要把视频做为背景时,设置为true,详情参见同层播放。 |
|
| x5_fullscreen | Boolean | 声明视频播放时是否进入到 TBS 的全屏模式,默认为 false。当需要把视频做为背景时,设置为 true,详情参见同层播放。 |
|
||||||
| x5_video_position | String | 声明视频播在界面上的位置,默认为“center”。可选值为:“top”,“center”,详情参见同层播放。 |
|
| x5_video_position | String | 声明视频播在界面上的位置,默认为“center”。可选值为:“top”,“center”,详情参见同层播放。 |
|
||||||
| x5_orientation | String | 声明TBS播放器支持的方向,可选值:landscape:横屏,portraint:竖屏,详情参见同层播放。 |
|
| x5_orientation | String | 声明 TBS 播放器支持的方向,可选值:landscape:横屏,portraint:竖屏,详情参见同层播放。 |
|
||||||
| x5LandscapeAsFullScreen | String | 声明TBS全屏播放是否横屏,默认值为true。 |
|
| x5LandscapeAsFullScreen | String | 声明 TBS 全屏播放是否横屏,默认值为 true。 |
|
||||||
| autoPlayDelay | Number | 延迟播放时间,单位为秒。详情参见延迟播放 |
|
| autoPlayDelay | Number | 延迟播放时间,单位为秒。详情参见延迟播放 |
|
||||||
| autoPlayDelayDisplayText | String | 延迟播放提示文本,详情参见延迟播放。 |
|
| autoPlayDelayDisplayText | String | 延迟播放提示文本,详情参见延迟播放。 |
|
||||||
| language | String | 国际化,默认为‘zh-cn’。如果未设置,则采用浏览器语言。可选值为‘zh-cn’、‘en-us’或其它值。 |
|
| language | String | 国际化,默认为‘zh-cn’。如果未设置,则采用浏览器语言。可选值为‘zh-cn’、‘en-us’或其它值。 |
|
||||||
| languageTexts | JSON | 自定义国际化文本json结构,key的值需要和language属性值对应起来。例子:{jp:{Play:”Play”}},自定义值参见Json结构。 |
|
| languageTexts | JSON | 自定义国际化文本 json 结构,key 的值需要和 language 属性值对应起来。例子:{jp:{Play:”Play”}},自定义值参见 Json 结构。 |
|
||||||
| snapshot | Boolean | flash启用截图功能。 |
|
| snapshot | Boolean | flash 启用截图功能。 |
|
||||||
| snapshotWatermark | Object | H5设置截图水印。 |
|
| snapshotWatermark | Object | H5 设置截图水印。 |
|
||||||
| useHlsPluginForSafari | Boolean | Safari浏览器可以启用Hls插件播放,Safari 11除外。 |
|
| useHlsPluginForSafari | Boolean | Safari 浏览器可以启用 Hls 插件播放,Safari 11 除外。 |
|
||||||
| enableStashBufferForFlv | Boolean | H5播放flv时,设置是否启用播放缓存,只在直播下起作用。 |
|
| enableStashBufferForFlv | Boolean | H5 播放 flv 时,设置是否启用播放缓存,只在直播下起作用。 |
|
||||||
| stashInitialSizeForFlv | Number | H5播放flv时,初始缓存大小,只在直播下起作用。 |
|
| stashInitialSizeForFlv | Number | H5 播放 flv 时,初始缓存大小,只在直播下起作用。 |
|
||||||
| loadDataTimeout | Number | 缓冲多长时间后,提示用户切换低清晰度,默认:20秒。 |
|
| loadDataTimeout | Number | 缓冲多长时间后,提示用户切换低清晰度,默认:20 秒。 |
|
||||||
| waitingTimeout | Number | 最大缓冲超时时间,超过这个时间会有错误提示,默认:60秒。 |
|
| waitingTimeout | Number | 最大缓冲超时时间,超过这个时间会有错误提示,默认:60 秒。 |
|
||||||
| liveStartTime | String | 直播开始时间,直播时移功能使用,格式为:“2018/01/04 12:00:00”。 |
|
| liveStartTime | String | 直播开始时间,直播时移功能使用,格式为:“2018/01/04 12:00:00”。 |
|
||||||
| liveOverTime | String | 直播结束时间,直播时移功能使用,格式为:“2018/01/04 12:00:00”。 |
|
| liveOverTime | String | 直播结束时间,直播时移功能使用,格式为:“2018/01/04 12:00:00”。 |
|
||||||
| liveTimeShiftUrl | String | 直播可用时移查询地址,详情参见直播时移。 |
|
| liveTimeShiftUrl | String | 直播可用时移查询地址,详情参见直播时移。 |
|
||||||
| liveShiftSource | String | flv直播地址播放时,hls的流地址,详情参见直播时移。 |
|
| liveShiftSource | String | flv 直播地址播放时,hls 的流地址,详情参见直播时移。 |
|
||||||
| recreatePlayer | Function | flv直播和hls时移切换是,重新创建播放器方法,详情参见直播时移。 |
|
| recreatePlayer | Function | flv 直播和 hls 时移切换是,重新创建播放器方法,详情参见直播时移。 |
|
||||||
| diagnosisButtonVisible | Boolean | 是否显示检测按钮,默认为true。 |
|
| diagnosisButtonVisible | Boolean | 是否显示检测按钮,默认为 true。 |
|
||||||
| disableSeek | Boolean | 禁用进度条的Seek,默认为false,仅Flash支持。 |
|
| disableSeek | Boolean | 禁用进度条的 Seek,默认为 false,仅 Flash 支持。 |
|
||||||
| encryptType | int | 加密类型,播放点播私有加密视频时,设置值为1,默认值为0。 |
|
| encryptType | int | 加密类型,播放点播私有加密视频时,设置值为 1,默认值为 0。 |
|
||||||
| progressMarkers | Array | 进度条打点内容数组,详情参见进度条打点。 |
|
| progressMarkers | Array | 进度条打点内容数组,详情参见进度条打点。 |
|
||||||
| vodRetry | int | 点播失败重试次数,默认3次 |
|
| vodRetry | int | 点播失败重试次数,默认 3 次 |
|
||||||
| liveRetry | int | 直播播放失败重试次数,默认5次 |
|
| liveRetry | int | 直播播放失败重试次数,默认 5 次 |
|
||||||
|
|
||||||
### 3.2 播放器方法
|
### 3.2 播放器方法
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// 暂停播放
|
// 暂停播放
|
||||||
this.$refs.VueAliplayerV2.pause();
|
this.$refs.VueAliplayerV2.pause();
|
||||||
```
|
```
|
||||||
|
|
||||||
可以参考 [播放器接口方法](https://help.aliyun.com/document_detail/125572.html?spm=a2c4g.11186623.6.1085.36fc6fc57WKZ5P#h2-u64ADu653Eu5668u63A5u53E32)
|
可以参考 [播放器接口方法](https://help.aliyun.com/document_detail/125572.html?spm=a2c4g.11186623.6.1085.36fc6fc57WKZ5P#h2-u64ADu653Eu5668u63A5u53E32)
|
||||||
|
|
||||||
| 名称 | 参数 | 说明 |
|
| 名称 | 参数 | 说明 |
|
||||||
| :- | :- | :- |
|
| :--------------------- | :------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| play | - | 播放视频。 |
|
| play | - | 播放视频。 |
|
||||||
| pause | - | 暂停视频。 |
|
| pause | - | 暂停视频。 |
|
||||||
| replay | - | 重播视频。 |
|
| replay | - | 重播视频。 |
|
||||||
| seek | time | 跳转到某个时刻进行播放,time的单位为秒。 |
|
| seek | time | 跳转到某个时刻进行播放,time 的单位为秒。 |
|
||||||
| getCurrentTime | - | 获取当前的播放时刻,返回的单位为秒。 |
|
| getCurrentTime | - | 获取当前的播放时刻,返回的单位为秒。 |
|
||||||
| getDuration | - | 获取视频总时长,返回的单位为秒,这个需要在视频加载完成以后才可以获取到,可以在play事件后获取。 |
|
| getDuration | - | 获取视频总时长,返回的单位为秒,这个需要在视频加载完成以后才可以获取到,可以在 play 事件后获取。 |
|
||||||
| getVolume | - | 获取当前的音量,返回值为0-1的实数。ios和部分android会失效。 |
|
| getVolume | - | 获取当前的音量,返回值为 0-1 的实数。ios 和部分 android 会失效。 |
|
||||||
| setVolume | - | 设置音量,vol为0-1的实数,ios和部分android会失效。 |
|
| setVolume | - | 设置音量,vol 为 0-1 的实数,ios 和部分 android 会失效。 |
|
||||||
| loadByUrl | url,time | 直接播放视频url,time为可选值(单位秒)。目前只支持同种格式(mp4/flv/m3u8)之间切换。暂不支持直播rtmp流切换。 |
|
| loadByUrl | url,time | 直接播放视频 url,time 为可选值(单位秒)。目前只支持同种格式(mp4/flv/m3u8)之间切换。暂不支持直播 rtmp 流切换。 |
|
||||||
| replayByVidAndPlayAuth | vid:视频id,playauth:播放凭证 | 目前只支持H5播放器。暂不支持不同格式视频间的之间切换。暂不支持直播rtmp流切换。 |
|
| replayByVidAndPlayAuth | vid:视频 id,playauth:播放凭证 | 目前只支持 H5 播放器。暂不支持不同格式视频间的之间切换。暂不支持直播 rtmp 流切换。 |
|
||||||
| replayByVidAndAuthInfo | 仅MPS用户时使用,参数顺序为:vid、accId、accSecret、stsToken、authInfo、domainRegion | 目前只支持H5播放器。暂不支持不同格式视频间的之间切换。暂不支持直播rtmp流切换。 |
|
| replayByVidAndAuthInfo | 仅 MPS 用户时使用,参数顺序为:vid、accId、accSecret、stsToken、authInfo、domainRegion | 目前只支持 H5 播放器。暂不支持不同格式视频间的之间切换。暂不支持直播 rtmp 流切换。 |
|
||||||
| setPlayerSize | w,h | 设置播放器大小w,h可分别为400px像素或60%百分比。chrome浏览器下flash播放器分别不能小于397x297。 |
|
| setPlayerSize | w,h | 设置播放器大小 w,h 可分别为 400px 像素或 60%百分比。chrome 浏览器下 flash 播放器分别不能小于 397x297。 |
|
||||||
| setSpeed | speed | 手动设置播放的倍速,倍速播放仅H5支持。移动端可能会失效,比如android微信。倍速播放UI默认是开启的。如果自定义过skinLaout属性,需要添加speedButton项到数组里: |
|
| setSpeed | speed | 手动设置播放的倍速,倍速播放仅 H5 支持。移动端可能会失效,比如 android 微信。倍速播放 UI 默认是开启的。如果自定义过 skinLaout 属性,需要添加 speedButton 项到数组里: |
|
||||||
| > | > | {name:“speedButton”,align:“tr”,x:10,y:23} |
|
| > | > | {name:“speedButton”,align:“tr”,x:10,y:23} |
|
||||||
| setSanpshotProperties | width:宽度,height:高度,rate:截图质量| 设置截图参数。 |
|
| setSanpshotProperties | width:宽度,height:高度,rate:截图质量 | 设置截图参数。 |
|
||||||
| requestFullScreen | - | 播放器全屏,仅H5支持。 |
|
| requestFullScreen | - | 播放器全屏,仅 H5 支持。 |
|
||||||
| cancelFullScreen | - | 播放器退出全屏,iOS调用无效,仅H5支持。 |
|
| cancelFullScreen | - | 播放器退出全屏,iOS 调用无效,仅 H5 支持。 |
|
||||||
| getIsFullScreen | - | 获取播放器全屏状态,仅H5支持。 |
|
| getIsFullScreen | - | 获取播放器全屏状态,仅 H5 支持。 |
|
||||||
| getStatus | - | 获取播放器状态,包含的值:‘init’,‘ready’,‘loading’,‘play’,‘pause’,‘playing’,‘waiting’,‘error’,‘ended’ |
|
| getStatus | - | 获取播放器状态,包含的值:‘init’,‘ready’,‘loading’,‘play’,‘pause’,‘playing’,‘waiting’,‘error’,‘ended’ |
|
||||||
| setLiveTimeRange | 开始时间,结束时间 | 设置直播的开始结束时间,开启直播时移功能时使用。例子:player.liveShiftSerivce.setLiveTimeRange(“”,‘2018/01/04 20:00:00’) |
|
| setLiveTimeRange | 开始时间,结束时间 | 设置直播的开始结束时间,开启直播时移功能时使用。例子:player.liveShiftSerivce.setLiveTimeRange(“”,‘2018/01/04 20:00:00’) |
|
||||||
| setRotate | rotate 旋转角度 | 参数为旋转角度, 正数为正时针旋转, 负数为逆时针旋转。例如: setRotate(90)。详情参见旋转和镜像。 |
|
| setRotate | rotate 旋转角度 | 参数为旋转角度, 正数为正时针旋转, 负数为逆时针旋转。例如: setRotate(90)。详情参见旋转和镜像。 |
|
||||||
| getRotate | - | 获取旋转角度。详情参见旋转和镜像。 |
|
| getRotate | - | 获取旋转角度。详情参见旋转和镜像。 |
|
||||||
| setImage | image:镜像类型,可选值为:horizon,vertical | 设置镜像,例如: setImage(‘horizon’)。详情参见旋转和镜像。 |
|
| setImage | image:镜像类型,可选值为:horizon,vertical | 设置镜像,例如: setImage(‘horizon’)。详情参见旋转和镜像。 |
|
||||||
| dispose | - | 播放器销毁 |
|
| dispose | - | 播放器销毁 |
|
||||||
| setCover | cover封面地址 | 设置封面 |
|
| setCover | cover 封面地址 | 设置封面 |
|
||||||
| setProgressMarkers | markers打点数据集合 | 设置打点数据 |
|
| setProgressMarkers | markers 打点数据集合 | 设置打点数据 |
|
||||||
| setPreviewTime | time试看时间 | 设置试看时间,单位为秒,详情参见试看 |
|
| setPreviewTime | time 试看时间 | 设置试看时间,单位为秒,详情参见试看 |
|
||||||
| getPreviewTime | - | 获取试看时间 |
|
| getPreviewTime | - | 获取试看时间 |
|
||||||
| isPreview | - | 是否试看 |
|
| isPreview | - | 是否试看 |
|
||||||
| off | ev:事件名[String],handle,事件回调方法[Function] | 通过播放器实例的off方法取消绑定的方法 |
|
| off | ev:事件名[String],handle,事件回调方法[Function] | 通过播放器实例的 off 方法取消绑定的方法 |
|
||||||
|
|
||||||
## 4.播放器事件
|
## 4.播放器事件
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<template>
|
<template>
|
||||||
<vue-aliplayer-v2 @ready="handleReady" />
|
<vue-aliplayer-v2 @ready="handleReady" />
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
methods:{
|
methods: {
|
||||||
/**
|
/**
|
||||||
* 播放器事件回调
|
* 播放器事件回调
|
||||||
*/
|
*/
|
||||||
handleReady(e){
|
handleReady(e) {
|
||||||
console.log(`ready`,e);
|
console.log(`ready`, e);
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
```
|
```
|
||||||
|
|
||||||
可以参考 [播放器事件](https://help.aliyun.com/document_detail/125572.html?spm=a2c4g.11186623.6.1085.36fc6fc57WKZ5P#h2-u64ADu653Eu5668u4E8Bu4EF63)
|
可以参考 [播放器事件](https://help.aliyun.com/document_detail/125572.html?spm=a2c4g.11186623.6.1085.36fc6fc57WKZ5P#h2-u64ADu653Eu5668u4E8Bu4EF63)
|
||||||
|
|
||||||
| 名称 | 说明 |
|
| 名称 | 说明 |
|
||||||
| :- | :- |
|
| :---------------- | :--------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| ready | 播放器视频初始化按钮渲染完毕。播放器UI初始设置需要此事件后触发,避免UI被初始化所覆盖。播放器提供的方法需要在此事件发生后才可以调用。 |
|
| ready | 播放器视频初始化按钮渲染完毕。播放器 UI 初始设置需要此事件后触发,避免 UI 被初始化所覆盖。播放器提供的方法需要在此事件发生后才可以调用。 |
|
||||||
| play | 视频由暂停恢复为播放时触发。 |
|
| play | 视频由暂停恢复为播放时触发。 |
|
||||||
| pause | 视频暂停时触发。 |
|
| pause | 视频暂停时触发。 |
|
||||||
| canplay | 能够开始播放音频/视频时发生,会多次触发,仅H5播放器。 |
|
| canplay | 能够开始播放音频/视频时发生,会多次触发,仅 H5 播放器。 |
|
||||||
| playing | 播放中,会触发多次。 |
|
| playing | 播放中,会触发多次。 |
|
||||||
| ended | 当前视频播放完毕时触发。 |
|
| ended | 当前视频播放完毕时触发。 |
|
||||||
| liveStreamStop | 直播流中断时触发。m3u8/flv/rtmp在重试5次未成功后触发。提示上层流中断或需要重新加载视频。PS:m3u8一直自动重试,不需要上层添加重试。 |
|
| liveStreamStop | 直播流中断时触发。m3u8/flv/rtmp 在重试 5 次未成功后触发。提示上层流中断或需要重新加载视频。PS:m3u8 一直自动重试,不需要上层添加重试。 |
|
||||||
| onM3u8Retry | m3u8直播流中断后重试事件,每次断流只触发一次。 |
|
| onM3u8Retry | m3u8 直播流中断后重试事件,每次断流只触发一次。 |
|
||||||
| hideBar | 控制栏自动隐藏事件。 |
|
| hideBar | 控制栏自动隐藏事件。 |
|
||||||
| showBar | 控制栏自动显示事件。 |
|
| showBar | 控制栏自动显示事件。 |
|
||||||
| waiting | 数据缓冲事件。 |
|
| waiting | 数据缓冲事件。 |
|
||||||
| timeupdate | 播放位置发生改变时触发,仅H5播放器。可通过getCurrentTime方法,得到当前播放时间。 |
|
| timeupdate | 播放位置发生改变时触发,仅 H5 播放器。可通过 getCurrentTime 方法,得到当前播放时间。 |
|
||||||
| snapshoted | 截图完成事件。 |
|
| snapshoted | 截图完成事件。 |
|
||||||
| requestFullScreen | 全屏事件,仅H5支持。 |
|
| requestFullScreen | 全屏事件,仅 H5 支持。 |
|
||||||
| cancelFullScreen | 取消全屏事件,iOS下不会触发,仅H5支持。 |
|
| cancelFullScreen | 取消全屏事件,iOS 下不会触发,仅 H5 支持。 |
|
||||||
| error | 错误事件。 |
|
| error | 错误事件。 |
|
||||||
| startSeek | 开始拖拽,参数返回拖拽点的时间。 |
|
| startSeek | 开始拖拽,参数返回拖拽点的时间。 |
|
||||||
| completeSeek | 完成拖拽,参数返回拖拽点的时间。 |
|
| completeSeek | 完成拖拽,参数返回拖拽点的时间。 |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 5. 图片展示
|
## 5. 图片展示
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 6.二次开发 下载项目
|
## 6.二次开发 下载项目
|
||||||
@ -375,6 +417,7 @@ git clone https://github.com/langyuxiansheng/vue-aliplayer-v2.git
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Project setup
|
## Project setup
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd vue-aliplayer-v2
|
cd vue-aliplayer-v2
|
||||||
|
|
||||||
@ -382,57 +425,79 @@ npm install
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Compiles and hot-reloads for development
|
### Compiles and hot-reloads for development
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run dev
|
npm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
### Compiles and minifies for production
|
### Compiles and minifies for production
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run build
|
npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
### Lints and fixes files
|
### Lints and fixes files
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run lint
|
npm run lint
|
||||||
```
|
```
|
||||||
|
|
||||||
## 7.缺陷 & 后期计划
|
## 7.缺陷 & 后期计划
|
||||||
> 2019年12月27日 更新优化局部引用方式
|
|
||||||
|
|
||||||
> 您有功能建议,或者bug反馈请留言.
|
> 2019 年 12 月 27 日 更新优化局部引用方式
|
||||||
|
|
||||||
|
> 您有功能建议,或者 bug 反馈请留言.
|
||||||
|
|
||||||
## 8.感谢
|
## 8.感谢
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
- vue-aliplayer 的作者,项目地址:https://github.com/slacrey/vue-aliplayer
|
- vue-aliplayer 的作者,项目地址:https://github.com/slacrey/vue-aliplayer
|
||||||
|
|
||||||
- Alipayer 阿里云的开源播放器 https://help.aliyun.com/document_detail/125572.html?spm=a2c4g.11186623.6.1085.36fc6fc57WKZ5P#h2-u64ADu653Eu5668u4E8Bu4EF63
|
- Alipayer 阿里云的开源播放器 https://help.aliyun.com/document_detail/125572.html?spm=a2c4g.11186623.6.1085.36fc6fc57WKZ5P#h2-u64ADu653Eu5668u4E8Bu4EF63
|
||||||
|
|
||||||
### Customize configuration
|
### Customize configuration
|
||||||
|
|
||||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
See [Configuration Reference](https://cli.vuejs.org/config/).
|
||||||
|
|
||||||
## 更新日志
|
## 更新日志
|
||||||
|
|
||||||
> v1.2.5 更换默认的播放器SDK版本2.8.2 => 2.9.0,2.8.2的版本存在多个播放器同时播放直播流异常的bug,增加了全局SDK版本配置,可以在Vue.use()的时候进行配置.
|
> v1.3.0 修复部分已知bug,增加forbidFastForward 属性,感谢 "william-xue"网友的功能提交.
|
||||||
|
|
||||||
> v1.2.4 修复多个播放器加载,只初始化一个播放器的bug.文档部分更新,增加了问题栏. 感谢"沙洲ad"的反馈与建议.
|
- sdk 版本更新,默认 SDK 版本由 2.9.3 更新为 2.9.20
|
||||||
|
- 默认注释更新
|
||||||
|
- 增加禁止用户拖拽快进的属性选项 forbidFastForward [Boolean] 默认 false
|
||||||
|
|
||||||
|
> v1.2.9 修正部分默认属性, 感谢"Schean17"网友的反馈与建议.
|
||||||
|
|
||||||
|
> v1.2.8 更换底层默认 sdk 版本为 2.9.3 修复 options 遇到 update loop 错误 感谢"litmonw"网友的反馈与建议.
|
||||||
|
|
||||||
|
> v1.2.7 更换底层默认 sdk 版本为 2.9.1 的版本. 更新线上演示 demo 的选项
|
||||||
|
|
||||||
|
> v1.2.6 优化 beforeDestroy() 部分的代码.
|
||||||
|
|
||||||
|
> v1.2.5 更换默认的播放器 SDK 版本 2.8.2 => 2.9.0,2.8.2 的版本存在多个播放器同时播放直播流异常的 bug,增加了全局 SDK 版本配置,可以在 Vue.use()的时候进行配置.
|
||||||
|
|
||||||
|
> v1.2.4 修复多个播放器加载,只初始化一个播放器的 bug.文档部分更新,增加了问题栏. 感谢"沙洲 ad"的反馈与建议.
|
||||||
|
|
||||||
> v1.2.3 优化播放器的初始化代码,调整包内结构,优化局部组件的注册方式,也兼容老版本的引用方式.文档部分更新,增加了问题栏. 感谢"liangzhiyuan2015"和"fancheur"两位网友的反馈与建议.
|
> v1.2.3 优化播放器的初始化代码,调整包内结构,优化局部组件的注册方式,也兼容老版本的引用方式.文档部分更新,增加了问题栏. 感谢"liangzhiyuan2015"和"fancheur"两位网友的反馈与建议.
|
||||||
|
|
||||||
> v1.2.2 修复指定id情况下,播放器报错"没有为播放器指定容器",目前移除外部指定id的方式,所有的播放器id都由内部生成,不再由外部指定容器(外部指定的意义并不大),其它的说明:更新1.2.1后报错Uncaught TypeError: 没有为播放器指定容器,因为源码中变更了部分代码,以及最大限度的简化代码,组件内部的根容器就只有一个div容器,导致以前外部指定id的时候,容器id与外部的不一致,导致抛出异常了,现在已经紧急修复了,若在使用,请更新到v1.2.2的版本;如果使用了外部指定id的方式请移除外部的id.否则id会出现重复的情况., 感谢"liyoro"的反馈和建议.
|
> v1.2.2 修复指定 id 情况下,播放器报错"没有为播放器指定容器",目前移除外部指定 id 的方式,所有的播放器 id 都由内部生成,不再由外部指定容器(外部指定的意义并不大),其它的说明:更新 1.2.1 后报错 Uncaught TypeError: 没有为播放器指定容器,因为源码中变更了部分代码,以及最大限度的简化代码,组件内部的根容器就只有一个 div 容器,导致以前外部指定 id 的时候,容器 id 与外部的不一致,导致抛出异常了,现在已经紧急修复了,若在使用,请更新到 v1.2.2 的版本;如果使用了外部指定 id 的方式请移除外部的 id.否则 id 会出现重复的情况., 感谢"liyoro"的反馈和建议.
|
||||||
|
|
||||||
> v1.2.1 修复直播播放的情况下,播放器已经销毁,而后台还在继续下载资源造成卡顿的bug,修复多个播放器只渲染1个的bug, 感谢"Jonauil"和"guangming95"两位网友的反馈和建议.
|
> v1.2.1 修复直播播放的情况下,播放器已经销毁,而后台还在继续下载资源造成卡顿的 bug,修复多个播放器只渲染 1 个的 bug, 感谢"Jonauil"和"guangming95"两位网友的反馈和建议.
|
||||||
|
|
||||||
> v1.2.0 修复播放源(MP4/m3u8)之间切换无法正常播放的bug,增加options配置项动态响应功能,优化部分播放器的逻辑, 感谢"liyoro"网友的反馈和建议.
|
> v1.2.0 修复播放源(MP4/m3u8)之间切换无法正常播放的 bug,增加 options 配置项动态响应功能,优化部分播放器的逻辑, 感谢"liyoro"网友的反馈和建议.
|
||||||
|
|
||||||
> v1.1.9 修复播放源(修复prop:source类型验证报错), 感谢"hugo2017"和“nullF”网友的反馈.
|
> v1.1.9 修复播放源(修复 prop:source 类型验证报错), 感谢"hugo2017"和“nullF”网友的反馈.
|
||||||
|
|
||||||
> v1.1.8 修复播放源(增加source属性类型错误),修复获取播放器状态 getStatus()方法报错, 感谢"kongjigu"网友的反馈.
|
> v1.1.8 修复播放源(增加 source 属性类型错误),修复获取播放器状态 getStatus()方法报错, 感谢"kongjigu"网友的反馈.
|
||||||
|
|
||||||
> v1.1.7 增加动态切换播放源(增加source属性)功能 感谢"wikimo"和"jieruian"两位网友的反馈建议.
|
> v1.1.7 增加动态切换播放源(增加 source 属性)功能 感谢"wikimo"和"jieruian"两位网友的反馈建议.
|
||||||
|
|
||||||
> v1.1.6 修复部分已知bug和优化局部的引用方式
|
> v1.1.6 修复部分已知 bug 和优化局部的引用方式
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 其它问题
|
## 其它问题
|
||||||
|
|
||||||
1. IOS 或者其它设备无法全屏播放,或者点击全屏按钮的时候也只是显示竖屏?
|
1. IOS 或者其它设备无法全屏播放,或者点击全屏按钮的时候也只是显示竖屏?
|
||||||
@ -440,7 +505,7 @@ See [Configuration Reference](https://cli.vuejs.org/config/).
|
|||||||
> 方案与问题所在:
|
> 方案与问题所在:
|
||||||
|
|
||||||
一般情况下可能是开启了强制竖屏(也就是屏幕锁定)打开后就会竖屏而不会全屏了!如下关闭就可以了:
|
一般情况下可能是开启了强制竖屏(也就是屏幕锁定)打开后就会竖屏而不会全屏了!如下关闭就可以了:
|
||||||
参考issues: https://github.com/langyuxiansheng/vue-aliplayer-v2/issues/25
|
参考 issues: https://github.com/langyuxiansheng/vue-aliplayer-v2/issues/25
|
||||||
|
|
||||||
-开启了屏幕锁定,只要上拉控制中心,点击屏幕锁定关闭就可以了!
|
-开启了屏幕锁定,只要上拉控制中心,点击屏幕锁定关闭就可以了!
|
||||||
|
|
||||||
|
109
examples/App.vue
109
examples/App.vue
@ -1,7 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="app">
|
<div id="app">
|
||||||
<template v-if="!isShowMultiple && show">
|
<template v-if="!isShowMultiple && show">
|
||||||
<vue-aliplayer-v2 :source="source" ref="VueAliplayerV2" :options="options" />
|
<vue-aliplayer-v2 :source="source" ref="VueAliplayerV2" :options="options"
|
||||||
|
:forbidFastForward="forbidFastForward"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<div v-if="isShowMultiple && show" class="show-multiple">
|
<div v-if="isShowMultiple && show" class="show-multiple">
|
||||||
<template v-for="x in 5">
|
<template v-for="x in 5">
|
||||||
@ -11,11 +13,13 @@
|
|||||||
<p class="remove-text" v-if="!show">播放器已销毁!</p>
|
<p class="remove-text" v-if="!show">播放器已销毁!</p>
|
||||||
<div class="player-btns">
|
<div class="player-btns">
|
||||||
<template v-if="!isShowMultiple && show">
|
<template v-if="!isShowMultiple && show">
|
||||||
|
|
||||||
<span @click="play()">播放</span>
|
<span @click="play()">播放</span>
|
||||||
<span @click="pause()">暂停</span>
|
<span @click="pause()">暂停</span>
|
||||||
<span @click="replay()">重播</span>
|
<span @click="replay()">重播</span>
|
||||||
<span @click="getCurrentTime()">播放时刻</span>
|
<span @click="getCurrentTime()">播放时刻</span>
|
||||||
<span @click="getStatus()">获取播放器状态</span>
|
<span @click="getStatus()">获取播放器状态</span>
|
||||||
|
<span @click="handlerForbidFastForward()">禁止快进</span>
|
||||||
</template>
|
</template>
|
||||||
<span @click="show = !show">{{ show ? '销毁' : '重载' }}</span>
|
<span @click="show = !show">{{ show ? '销毁' : '重载' }}</span>
|
||||||
<span @click="options.isLive = !options.isLive">{{ options.isLive ? '切换普通模式' : '切换直播模式' }}</span>
|
<span @click="options.isLive = !options.isLive">{{ options.isLive ? '切换普通模式' : '切换直播模式' }}</span>
|
||||||
@ -34,52 +38,109 @@
|
|||||||
<span class="source-label">输入播放源(支持动态切换):</span>
|
<span class="source-label">输入播放源(支持动态切换):</span>
|
||||||
<input class="source-input" type="text" v-model="source">
|
<input class="source-input" type="text" v-model="source">
|
||||||
</div>
|
</div>
|
||||||
|
<div class="source-box">
|
||||||
|
<span class="source-label">指定为flash:</span>
|
||||||
|
<select v-model="options.useFlashPrism">
|
||||||
|
<option :value="true">是</option>
|
||||||
|
<option :value="false">否</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="source-box">
|
||||||
|
<span class="source-label">禁止用户拖动(仅flash有效):</span>
|
||||||
|
<select v-model="options.disableSeek">
|
||||||
|
<option :value="true">是</option>
|
||||||
|
<option :value="false">否</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
// import VueAliplayerV2 from '../packages';
|
// import VueAliplayerV2 from '../packages';
|
||||||
export default {
|
export default {
|
||||||
// components:{ VueAliplayerV2 },
|
// components:{ VueAliplayerV2 },
|
||||||
data(){
|
data () {
|
||||||
return {
|
return {
|
||||||
options: {
|
options: {
|
||||||
// source:'//player.alicdn.com/video/aliyunmedia.mp4',
|
// source:'//player.alicdn.com/video/aliyunmedia.mp4',
|
||||||
isLive: true, //切换为直播流的时候必填
|
isLive: !true, //切换为直播流的时候必填
|
||||||
// format: 'm3u8' //切换为直播流的时候必填
|
// skinLayout: [
|
||||||
|
// {
|
||||||
|
// 'name': 'bigPlayButton',
|
||||||
|
// 'align': 'blabs',
|
||||||
|
// 'x': 30,
|
||||||
|
// 'y': 80
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// 'name': 'infoDisplay'
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// 'name': 'controlBar',
|
||||||
|
// 'align': 'blabs',
|
||||||
|
// 'x': 0,
|
||||||
|
// 'y': 0,
|
||||||
|
// 'children': [
|
||||||
|
// {
|
||||||
|
// 'name': 'liveDisplay',
|
||||||
|
// 'align': 'tlabs',
|
||||||
|
// 'x': 15,
|
||||||
|
// 'y': 6
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// 'name': 'fullScreenButton',
|
||||||
|
// 'align': 'tr',
|
||||||
|
// 'x': 10,
|
||||||
|
// 'y': 10
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// 'name': 'volume',
|
||||||
|
// 'align': 'tr',
|
||||||
|
// 'x': 5,
|
||||||
|
// 'y': 10
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// }]
|
||||||
|
// useFlashPrism: false, //指定为flash
|
||||||
|
// disableSeek: true //禁用进度条的Seek,默认值为false
|
||||||
},
|
},
|
||||||
source: '//player.alicdn.com/video/aliyunmedia.mp4',
|
source: '//player.alicdn.com/video/aliyunmedia.mp4',
|
||||||
// source: '//ivi.bupt.edu.cn/hls/cctv1.m3u8',
|
// source: '//ivi.bupt.edu.cn/hls/cctv1.m3u8',
|
||||||
show: true,
|
show: true,
|
||||||
isShowMultiple: false
|
forbidFastForward: false,
|
||||||
|
isShowMultiple: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods:{
|
methods: {
|
||||||
|
|
||||||
play(){
|
play () {
|
||||||
this.$refs.VueAliplayerV2.play()
|
this.$refs.VueAliplayerV2.play()
|
||||||
},
|
},
|
||||||
|
|
||||||
pause(){
|
pause () {
|
||||||
this.$refs.VueAliplayerV2.pause();
|
this.$refs.VueAliplayerV2.pause();
|
||||||
},
|
},
|
||||||
|
|
||||||
replay(){
|
replay () {
|
||||||
this.$refs.VueAliplayerV2.replay();
|
this.$refs.VueAliplayerV2.replay();
|
||||||
},
|
},
|
||||||
|
handlerForbidFastForward () {
|
||||||
|
|
||||||
getCurrentTime(){
|
this.forbidFastForward = true
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
getCurrentTime () {
|
||||||
// this.$refs.VueAliplayerV2.getCurrentTime();
|
// this.$refs.VueAliplayerV2.getCurrentTime();
|
||||||
this.source = 'http://ivi.bupt.edu.cn/hls/cctv1.m3u8';
|
this.source = 'http://ivi.bupt.edu.cn/hls/cctv1.m3u8';
|
||||||
},
|
},
|
||||||
|
|
||||||
getStatus(){
|
getStatus () {
|
||||||
const status = this.$refs.VueAliplayerV2.getStatus();
|
const status = this.$refs.VueAliplayerV2.getStatus();
|
||||||
console.log(`getStatus:`, status);
|
console.log(`getStatus:`, status);
|
||||||
alert(`getStatus:${status}`);
|
alert(`getStatus:${status}`);
|
||||||
},
|
},
|
||||||
|
|
||||||
showMultiple(){
|
showMultiple () {
|
||||||
this.isShowMultiple = !this.isShowMultiple;
|
this.isShowMultiple = !this.isShowMultiple;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -90,19 +151,19 @@ export default {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
.remove-text{
|
.remove-text {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
}
|
}
|
||||||
.show-multiple{
|
.show-multiple {
|
||||||
display: flex;
|
display: flex;
|
||||||
.multiple-player{
|
.multiple-player {
|
||||||
width: calc(100% / 4);
|
width: calc(100% / 4);
|
||||||
margin: 20px;
|
margin: 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.player-btns{
|
.player-btns {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@ -122,18 +183,18 @@ export default {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.source-box{
|
.source-box {
|
||||||
padding: 5px 10px;
|
padding: 5px 10px;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 10px;
|
||||||
.source-label{
|
.source-label {
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
#source{
|
#source {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
.source-input{
|
.source-input {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
padding: 5px 10px;
|
padding: 5px 10px;
|
||||||
width: 80%;
|
width: 80%;
|
||||||
|
23
gh-page.sh
Normal file
23
gh-page.sh
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
echo "打包 => dist";
|
||||||
|
|
||||||
|
npm run build;
|
||||||
|
|
||||||
|
echo "更新gh-pages";
|
||||||
|
|
||||||
|
git branch -D gh-pages;
|
||||||
|
|
||||||
|
echo "删除gh-pages";
|
||||||
|
|
||||||
|
git checkout -b gh-pages;
|
||||||
|
|
||||||
|
echo "创建并切换到gh-pages";
|
||||||
|
|
||||||
|
git add -f dist;
|
||||||
|
|
||||||
|
git commit -m 'create gh-pages';
|
||||||
|
|
||||||
|
git push origin -d gh-pages;
|
||||||
|
|
||||||
|
git subtree push --prefix dist origin gh-pages;
|
||||||
|
|
||||||
|
echo "已推送gh-pages";
|
@ -142,16 +142,29 @@ if (typeof window !== 'undefined') {
|
|||||||
// EXTERNAL MODULE: ./node_modules/_core-js@2.6.10@core-js/modules/es6.function.name.js
|
// EXTERNAL MODULE: ./node_modules/_core-js@2.6.10@core-js/modules/es6.function.name.js
|
||||||
var es6_function_name = __webpack_require__("7cfd");
|
var es6_function_name = __webpack_require__("7cfd");
|
||||||
|
|
||||||
// CONCATENATED MODULE: ./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"05d0d90a-vue-loader-template"}!./node_modules/_vue-loader@15.7.2@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.7.2@vue-loader/lib??vue-loader-options!./packages/AliplayerV2/index.vue?vue&type=template&id=d74f17bc&
|
// CONCATENATED MODULE: ./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"05d0d90a-vue-loader-template"}!./node_modules/_vue-loader@15.7.2@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.7.2@vue-loader/lib??vue-loader-options!./packages/AliplayerV2/index.vue?vue&type=template&id=c8a41478&
|
||||||
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":_vm.playerId}})}
|
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":_vm.playerId}})}
|
||||||
var staticRenderFns = []
|
var staticRenderFns = []
|
||||||
|
|
||||||
|
|
||||||
// CONCATENATED MODULE: ./packages/AliplayerV2/index.vue?vue&type=template&id=d74f17bc&
|
// CONCATENATED MODULE: ./packages/AliplayerV2/index.vue?vue&type=template&id=c8a41478&
|
||||||
|
|
||||||
// EXTERNAL MODULE: ./node_modules/_core-js@2.6.10@core-js/modules/web.dom.iterable.js
|
// CONCATENATED MODULE: ./node_modules/_@babel_runtime@7.7.2@@babel/runtime/helpers/esm/typeof.js
|
||||||
var web_dom_iterable = __webpack_require__("4634");
|
function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
|
||||||
|
|
||||||
|
function _typeof(obj) {
|
||||||
|
if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") {
|
||||||
|
_typeof = function _typeof(obj) {
|
||||||
|
return _typeof2(obj);
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
_typeof = function _typeof(obj) {
|
||||||
|
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return _typeof(obj);
|
||||||
|
}
|
||||||
// EXTERNAL MODULE: ./node_modules/_core-js@2.6.10@core-js/modules/es6.regexp.to-string.js
|
// EXTERNAL MODULE: ./node_modules/_core-js@2.6.10@core-js/modules/es6.regexp.to-string.js
|
||||||
var es6_regexp_to_string = __webpack_require__("cc1d");
|
var es6_regexp_to_string = __webpack_require__("cc1d");
|
||||||
|
|
||||||
@ -164,6 +177,12 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
|
|||||||
/* harmony default export */ var AliplayerV2vue_type_script_lang_js_ = ({
|
/* harmony default export */ var AliplayerV2vue_type_script_lang_js_ = ({
|
||||||
name: 'VueAliplayerV2',
|
name: 'VueAliplayerV2',
|
||||||
props: {
|
props: {
|
||||||
|
forbidFastForward: {
|
||||||
|
//禁止拖拽快进
|
||||||
|
required: false,
|
||||||
|
type: [Boolean],
|
||||||
|
default: false
|
||||||
|
},
|
||||||
options: {
|
options: {
|
||||||
//配置项
|
//配置项
|
||||||
required: false,
|
required: false,
|
||||||
@ -182,13 +201,13 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
|
|||||||
//css版本源
|
//css版本源
|
||||||
required: false,
|
required: false,
|
||||||
type: [String],
|
type: [String],
|
||||||
default: "https://g.alicdn.com/de/prismplayer/2.9.0/skins/default/aliplayer-min.css"
|
default: "https://g.alicdn.com/de/prismplayer/2.9.20/skins/default/aliplayer-min.css"
|
||||||
},
|
},
|
||||||
scriptSrc: {
|
scriptSrc: {
|
||||||
//js版本源
|
//js版本源
|
||||||
required: false,
|
required: false,
|
||||||
type: [String],
|
type: [String],
|
||||||
default: "https://g.alicdn.com/de/prismplayer/2.9.0/aliplayer-min.js"
|
default: "https://g.alicdn.com/de/prismplayer/2.9.20/aliplayer-min.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data: function data() {
|
data: function data() {
|
||||||
@ -291,6 +310,9 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
|
|||||||
//监听播放源变化
|
//监听播放源变化
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
|
forbidFastForward: function forbidFastForward() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
options: {
|
options: {
|
||||||
//配置项是对象,只能深度监听
|
//配置项是对象,只能深度监听
|
||||||
handler: function handler() {
|
handler: function handler() {
|
||||||
@ -315,6 +337,8 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handlerFastForward: function handlerFastForward() {},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建script和css
|
* 创建script和css
|
||||||
* 加载Alipayer的SDK
|
* 加载Alipayer的SDK
|
||||||
@ -322,8 +346,8 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
|
|||||||
init: function init() {
|
init: function init() {
|
||||||
var _this3 = this;
|
var _this3 = this;
|
||||||
|
|
||||||
var linkID = 'aliplayer-min-css';
|
var linkID = 'app__aliplayer-min-css';
|
||||||
var scriptID = 'aliplayer-min-js';
|
var scriptID = 'app__aliplayer-min-js';
|
||||||
var head = document.getElementsByTagName('head');
|
var head = document.getElementsByTagName('head');
|
||||||
var html = document.getElementsByTagName('html');
|
var html = document.getElementsByTagName('html');
|
||||||
var scriptTag = document.getElementById(scriptID);
|
var scriptTag = document.getElementById(scriptID);
|
||||||
@ -335,7 +359,8 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
|
|||||||
link.type = 'text/css';
|
link.type = 'text/css';
|
||||||
link.rel = 'stylesheet';
|
link.rel = 'stylesheet';
|
||||||
link.href = this.cssLink;
|
link.href = this.cssLink;
|
||||||
link.id = linkID;
|
link.id = linkID; // link.className = linkID;
|
||||||
|
|
||||||
head[0].appendChild(link);
|
head[0].appendChild(link);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -343,7 +368,8 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
|
|||||||
// console.log('scriptTag');
|
// console.log('scriptTag');
|
||||||
scriptTag = document.createElement('script');
|
scriptTag = document.createElement('script');
|
||||||
scriptTag.type = "text/javascript";
|
scriptTag.type = "text/javascript";
|
||||||
scriptTag.id = scriptID;
|
scriptTag.id = scriptID; // scriptTag.className = scriptID;
|
||||||
|
|
||||||
scriptTag.src = this.scriptSrc;
|
scriptTag.src = this.scriptSrc;
|
||||||
html[0].appendChild(scriptTag);
|
html[0].appendChild(scriptTag);
|
||||||
} else {
|
} else {
|
||||||
@ -364,7 +390,7 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
|
|||||||
var _this4 = this;
|
var _this4 = this;
|
||||||
|
|
||||||
if (typeof window.Aliplayer != 'undefined') {
|
if (typeof window.Aliplayer != 'undefined') {
|
||||||
var options = this.options;
|
var options = this.deepCloneObject(this.options);
|
||||||
|
|
||||||
if (options) {
|
if (options) {
|
||||||
for (var key in options) {
|
for (var key in options) {
|
||||||
@ -389,6 +415,25 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
|
|||||||
|
|
||||||
for (var ev in this.events) {
|
for (var ev in this.events) {
|
||||||
_loop(ev);
|
_loop(ev);
|
||||||
|
} //开启禁止拖拽快进
|
||||||
|
|
||||||
|
|
||||||
|
if (this.forbidFastForward) {
|
||||||
|
var last = 0,
|
||||||
|
max_time = 0;
|
||||||
|
this.player.on('timeupdate', function () {
|
||||||
|
var current = this.getCurrentTime();
|
||||||
|
|
||||||
|
if (current - last > 2) {
|
||||||
|
this.seek(last);
|
||||||
|
} else {
|
||||||
|
last = current;
|
||||||
|
|
||||||
|
if (last >= max_time) {
|
||||||
|
max_time = last;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
} //通过播放器实例的off方法取消订阅
|
} //通过播放器实例的off方法取消订阅
|
||||||
//player.off('ready',handleReady);
|
//player.off('ready',handleReady);
|
||||||
|
|
||||||
@ -668,18 +713,45 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
|
|||||||
*/
|
*/
|
||||||
off: function off(ev, handle) {
|
off: function off(ev, handle) {
|
||||||
this.player && this.player.off(ev, handle);
|
this.player && this.player.off(ev, handle);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 深度拷贝
|
||||||
|
* @param {*} obj
|
||||||
|
*/
|
||||||
|
deepCloneObject: function deepCloneObject(obj) {
|
||||||
|
var objClone = Array.isArray(obj) ? [] : {};
|
||||||
|
|
||||||
|
if (obj && _typeof(obj) === 'object') {
|
||||||
|
for (var key in obj) {
|
||||||
|
if (obj.hasOwnProperty(key)) {
|
||||||
|
//判断ojb子元素是否为对象,如果是,递归复制
|
||||||
|
if (obj[key] && _typeof(obj[key]) === 'object') {
|
||||||
|
objClone[key] = this.deepCloneObject(obj[key]);
|
||||||
|
} else {
|
||||||
|
//如果不是,简单复制
|
||||||
|
objClone[key] = obj[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return objClone;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy: function beforeDestroy() {
|
beforeDestroy: function beforeDestroy() {
|
||||||
//防止重复创建
|
//防止重复创建
|
||||||
this.dispose(); //销毁播放器(防止直播播放的情况下,播放器已经销毁,而后台还在继续下载资源造成卡顿的bug)
|
this.dispose(); //销毁播放器(防止直播播放的情况下,播放器已经销毁,而后台还在继续下载资源造成卡顿的bug)
|
||||||
|
// const head = document.querySelector('head');
|
||||||
var head = document.querySelector('head'); //移除所有的重复创建的标签
|
// const cssNodes = document.querySelectorAll(`link.app__aliplayer-min-css`);
|
||||||
|
// (html && cssNodes.length > 1) && cssNodes.forEach((item, index)=>{
|
||||||
var nodes = document.querySelectorAll('script[src="https://g.alicdn.com/de/prismplayer/2.8.2/hls/aliplayer-hls-min.js"]');
|
// if(index != 0) head.removeChild(item);
|
||||||
head && nodes.forEach(function (item) {
|
// });
|
||||||
head.removeChild(item);
|
// const html = document.querySelector('html');
|
||||||
});
|
// const jsNodes = document.querySelectorAll(`script.app__aliplayer-min-js`);
|
||||||
|
// (html && jsNodes.length > 1) && jsNodes.forEach((item, index)=>{
|
||||||
|
// if(index != 0) html.removeChild(item);
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// CONCATENATED MODULE: ./packages/AliplayerV2/index.vue?vue&type=script&lang=js&
|
// CONCATENATED MODULE: ./packages/AliplayerV2/index.vue?vue&type=script&lang=js&
|
||||||
@ -820,113 +892,6 @@ AliplayerV2.Player = AliplayerV2;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "1277":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
var store = __webpack_require__("f341")('wks');
|
|
||||||
var uid = __webpack_require__("4d2c");
|
|
||||||
var Symbol = __webpack_require__("3f8b").Symbol;
|
|
||||||
var USE_SYMBOL = typeof Symbol == 'function';
|
|
||||||
|
|
||||||
var $exports = module.exports = function (name) {
|
|
||||||
return store[name] || (store[name] =
|
|
||||||
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
|
|
||||||
};
|
|
||||||
|
|
||||||
$exports.store = store;
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "17cb":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
var document = __webpack_require__("3f8b").document;
|
|
||||||
module.exports = document && document.documentElement;
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "1f9e":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
// false -> Array#indexOf
|
|
||||||
// true -> Array#includes
|
|
||||||
var toIObject = __webpack_require__("6117");
|
|
||||||
var toLength = __webpack_require__("8941");
|
|
||||||
var toAbsoluteIndex = __webpack_require__("c3a9");
|
|
||||||
module.exports = function (IS_INCLUDES) {
|
|
||||||
return function ($this, el, fromIndex) {
|
|
||||||
var O = toIObject($this);
|
|
||||||
var length = toLength(O.length);
|
|
||||||
var index = toAbsoluteIndex(fromIndex, length);
|
|
||||||
var value;
|
|
||||||
// Array#includes uses SameValueZero equality algorithm
|
|
||||||
// eslint-disable-next-line no-self-compare
|
|
||||||
if (IS_INCLUDES && el != el) while (length > index) {
|
|
||||||
value = O[index++];
|
|
||||||
// eslint-disable-next-line no-self-compare
|
|
||||||
if (value != value) return true;
|
|
||||||
// Array#indexOf ignores holes, Array#includes - not
|
|
||||||
} else for (;length > index; index++) if (IS_INCLUDES || index in O) {
|
|
||||||
if (O[index] === el) return IS_INCLUDES || index || 0;
|
|
||||||
} return !IS_INCLUDES && -1;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "2498":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
var global = __webpack_require__("3f8b");
|
|
||||||
var core = __webpack_require__("da27");
|
|
||||||
var hide = __webpack_require__("b8ea");
|
|
||||||
var redefine = __webpack_require__("a6d5");
|
|
||||||
var ctx = __webpack_require__("e85e");
|
|
||||||
var PROTOTYPE = 'prototype';
|
|
||||||
|
|
||||||
var $export = function (type, name, source) {
|
|
||||||
var IS_FORCED = type & $export.F;
|
|
||||||
var IS_GLOBAL = type & $export.G;
|
|
||||||
var IS_STATIC = type & $export.S;
|
|
||||||
var IS_PROTO = type & $export.P;
|
|
||||||
var IS_BIND = type & $export.B;
|
|
||||||
var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];
|
|
||||||
var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
|
|
||||||
var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
|
|
||||||
var key, own, out, exp;
|
|
||||||
if (IS_GLOBAL) source = name;
|
|
||||||
for (key in source) {
|
|
||||||
// contains in native
|
|
||||||
own = !IS_FORCED && target && target[key] !== undefined;
|
|
||||||
// export native or passed
|
|
||||||
out = (own ? target : source)[key];
|
|
||||||
// bind timers to global for call from export context
|
|
||||||
exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
|
|
||||||
// extend global
|
|
||||||
if (target) redefine(target, key, out, type & $export.U);
|
|
||||||
// export
|
|
||||||
if (exports[key] != out) hide(exports, key, exp);
|
|
||||||
if (IS_PROTO && expProto[key] != out) expProto[key] = out;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
global.core = core;
|
|
||||||
// type bitmap
|
|
||||||
$export.F = 1; // forced
|
|
||||||
$export.G = 2; // global
|
|
||||||
$export.S = 4; // static
|
|
||||||
$export.P = 8; // proto
|
|
||||||
$export.B = 16; // bind
|
|
||||||
$export.W = 32; // wrap
|
|
||||||
$export.U = 64; // safe
|
|
||||||
$export.R = 128; // real proto method for `library`
|
|
||||||
module.exports = $export;
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "25ae":
|
/***/ "25ae":
|
||||||
@ -956,32 +921,6 @@ module.exports = function (it, S) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "3038":
|
|
||||||
/***/ (function(module, exports) {
|
|
||||||
|
|
||||||
// 7.2.1 RequireObjectCoercible(argument)
|
|
||||||
module.exports = function (it) {
|
|
||||||
if (it == undefined) throw TypeError("Can't call method on " + it);
|
|
||||||
return it;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "3d87":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
var def = __webpack_require__("d3d8").f;
|
|
||||||
var has = __webpack_require__("549d");
|
|
||||||
var TAG = __webpack_require__("1277")('toStringTag');
|
|
||||||
|
|
||||||
module.exports = function (it, tag, stat) {
|
|
||||||
if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "3f8b":
|
/***/ "3f8b":
|
||||||
@ -995,148 +934,6 @@ var global = module.exports = typeof window != 'undefined' && window.Math == Mat
|
|||||||
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
|
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "4634":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
var $iterators = __webpack_require__("96dd");
|
|
||||||
var getKeys = __webpack_require__("7d56");
|
|
||||||
var redefine = __webpack_require__("a6d5");
|
|
||||||
var global = __webpack_require__("3f8b");
|
|
||||||
var hide = __webpack_require__("b8ea");
|
|
||||||
var Iterators = __webpack_require__("e3b3");
|
|
||||||
var wks = __webpack_require__("1277");
|
|
||||||
var ITERATOR = wks('iterator');
|
|
||||||
var TO_STRING_TAG = wks('toStringTag');
|
|
||||||
var ArrayValues = Iterators.Array;
|
|
||||||
|
|
||||||
var DOMIterables = {
|
|
||||||
CSSRuleList: true, // TODO: Not spec compliant, should be false.
|
|
||||||
CSSStyleDeclaration: false,
|
|
||||||
CSSValueList: false,
|
|
||||||
ClientRectList: false,
|
|
||||||
DOMRectList: false,
|
|
||||||
DOMStringList: false,
|
|
||||||
DOMTokenList: true,
|
|
||||||
DataTransferItemList: false,
|
|
||||||
FileList: false,
|
|
||||||
HTMLAllCollection: false,
|
|
||||||
HTMLCollection: false,
|
|
||||||
HTMLFormElement: false,
|
|
||||||
HTMLSelectElement: false,
|
|
||||||
MediaList: true, // TODO: Not spec compliant, should be false.
|
|
||||||
MimeTypeArray: false,
|
|
||||||
NamedNodeMap: false,
|
|
||||||
NodeList: true,
|
|
||||||
PaintRequestList: false,
|
|
||||||
Plugin: false,
|
|
||||||
PluginArray: false,
|
|
||||||
SVGLengthList: false,
|
|
||||||
SVGNumberList: false,
|
|
||||||
SVGPathSegList: false,
|
|
||||||
SVGPointList: false,
|
|
||||||
SVGStringList: false,
|
|
||||||
SVGTransformList: false,
|
|
||||||
SourceBufferList: false,
|
|
||||||
StyleSheetList: true, // TODO: Not spec compliant, should be false.
|
|
||||||
TextTrackCueList: false,
|
|
||||||
TextTrackList: false,
|
|
||||||
TouchList: false
|
|
||||||
};
|
|
||||||
|
|
||||||
for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {
|
|
||||||
var NAME = collections[i];
|
|
||||||
var explicit = DOMIterables[NAME];
|
|
||||||
var Collection = global[NAME];
|
|
||||||
var proto = Collection && Collection.prototype;
|
|
||||||
var key;
|
|
||||||
if (proto) {
|
|
||||||
if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);
|
|
||||||
if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
|
|
||||||
Iterators[NAME] = ArrayValues;
|
|
||||||
if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "4aef":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var LIBRARY = __webpack_require__("6cc2");
|
|
||||||
var $export = __webpack_require__("2498");
|
|
||||||
var redefine = __webpack_require__("a6d5");
|
|
||||||
var hide = __webpack_require__("b8ea");
|
|
||||||
var Iterators = __webpack_require__("e3b3");
|
|
||||||
var $iterCreate = __webpack_require__("c264");
|
|
||||||
var setToStringTag = __webpack_require__("3d87");
|
|
||||||
var getPrototypeOf = __webpack_require__("d15b");
|
|
||||||
var ITERATOR = __webpack_require__("1277")('iterator');
|
|
||||||
var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
|
|
||||||
var FF_ITERATOR = '@@iterator';
|
|
||||||
var KEYS = 'keys';
|
|
||||||
var VALUES = 'values';
|
|
||||||
|
|
||||||
var returnThis = function () { return this; };
|
|
||||||
|
|
||||||
module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
|
|
||||||
$iterCreate(Constructor, NAME, next);
|
|
||||||
var getMethod = function (kind) {
|
|
||||||
if (!BUGGY && kind in proto) return proto[kind];
|
|
||||||
switch (kind) {
|
|
||||||
case KEYS: return function keys() { return new Constructor(this, kind); };
|
|
||||||
case VALUES: return function values() { return new Constructor(this, kind); };
|
|
||||||
} return function entries() { return new Constructor(this, kind); };
|
|
||||||
};
|
|
||||||
var TAG = NAME + ' Iterator';
|
|
||||||
var DEF_VALUES = DEFAULT == VALUES;
|
|
||||||
var VALUES_BUG = false;
|
|
||||||
var proto = Base.prototype;
|
|
||||||
var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
|
|
||||||
var $default = $native || getMethod(DEFAULT);
|
|
||||||
var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
|
|
||||||
var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
|
|
||||||
var methods, key, IteratorPrototype;
|
|
||||||
// Fix native
|
|
||||||
if ($anyNative) {
|
|
||||||
IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
|
|
||||||
if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
|
|
||||||
// Set @@toStringTag to native iterators
|
|
||||||
setToStringTag(IteratorPrototype, TAG, true);
|
|
||||||
// fix for some old engines
|
|
||||||
if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// fix Array#{values, @@iterator}.name in V8 / FF
|
|
||||||
if (DEF_VALUES && $native && $native.name !== VALUES) {
|
|
||||||
VALUES_BUG = true;
|
|
||||||
$default = function values() { return $native.call(this); };
|
|
||||||
}
|
|
||||||
// Define iterator
|
|
||||||
if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
|
|
||||||
hide(proto, ITERATOR, $default);
|
|
||||||
}
|
|
||||||
// Plug for library
|
|
||||||
Iterators[NAME] = $default;
|
|
||||||
Iterators[TAG] = returnThis;
|
|
||||||
if (DEFAULT) {
|
|
||||||
methods = {
|
|
||||||
values: DEF_VALUES ? $default : getMethod(VALUES),
|
|
||||||
keys: IS_SET ? $default : getMethod(KEYS),
|
|
||||||
entries: $entries
|
|
||||||
};
|
|
||||||
if (FORCED) for (key in methods) {
|
|
||||||
if (!(key in proto)) redefine(proto, key, methods[key]);
|
|
||||||
} else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
|
|
||||||
}
|
|
||||||
return methods;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "4d2c":
|
/***/ "4d2c":
|
||||||
@ -1160,79 +957,6 @@ module.exports = function (it, key) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "6077":
|
|
||||||
/***/ (function(module, exports) {
|
|
||||||
|
|
||||||
var toString = {}.toString;
|
|
||||||
|
|
||||||
module.exports = function (it) {
|
|
||||||
return toString.call(it).slice(8, -1);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "6117":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
// to indexed object, toObject with fallback for non-array-like ES3 strings
|
|
||||||
var IObject = __webpack_require__("9952");
|
|
||||||
var defined = __webpack_require__("3038");
|
|
||||||
module.exports = function (it) {
|
|
||||||
return IObject(defined(it));
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "65c3":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
|
|
||||||
var anObject = __webpack_require__("8cac");
|
|
||||||
var dPs = __webpack_require__("8d69");
|
|
||||||
var enumBugKeys = __webpack_require__("d93f");
|
|
||||||
var IE_PROTO = __webpack_require__("9947")('IE_PROTO');
|
|
||||||
var Empty = function () { /* empty */ };
|
|
||||||
var PROTOTYPE = 'prototype';
|
|
||||||
|
|
||||||
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
|
||||||
var createDict = function () {
|
|
||||||
// Thrash, waste and sodomy: IE GC bug
|
|
||||||
var iframe = __webpack_require__("6618")('iframe');
|
|
||||||
var i = enumBugKeys.length;
|
|
||||||
var lt = '<';
|
|
||||||
var gt = '>';
|
|
||||||
var iframeDocument;
|
|
||||||
iframe.style.display = 'none';
|
|
||||||
__webpack_require__("17cb").appendChild(iframe);
|
|
||||||
iframe.src = 'javascript:'; // eslint-disable-line no-script-url
|
|
||||||
// createDict = iframe.contentWindow.Object;
|
|
||||||
// html.removeChild(iframe);
|
|
||||||
iframeDocument = iframe.contentWindow.document;
|
|
||||||
iframeDocument.open();
|
|
||||||
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
|
|
||||||
iframeDocument.close();
|
|
||||||
createDict = iframeDocument.F;
|
|
||||||
while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
|
|
||||||
return createDict();
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = Object.create || function create(O, Properties) {
|
|
||||||
var result;
|
|
||||||
if (O !== null) {
|
|
||||||
Empty[PROTOTYPE] = anObject(O);
|
|
||||||
result = new Empty();
|
|
||||||
Empty[PROTOTYPE] = null;
|
|
||||||
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
||||||
result[IE_PROTO] = O;
|
|
||||||
} else result = createDict();
|
|
||||||
return Properties === undefined ? result : dPs(result, Properties);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "6618":
|
/***/ "6618":
|
||||||
@ -1263,30 +987,6 @@ module.exports = false;
|
|||||||
module.exports = __webpack_require__("f341")('native-function-to-string', Function.toString);
|
module.exports = __webpack_require__("f341")('native-function-to-string', Function.toString);
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "7afe":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
var has = __webpack_require__("549d");
|
|
||||||
var toIObject = __webpack_require__("6117");
|
|
||||||
var arrayIndexOf = __webpack_require__("1f9e")(false);
|
|
||||||
var IE_PROTO = __webpack_require__("9947")('IE_PROTO');
|
|
||||||
|
|
||||||
module.exports = function (object, names) {
|
|
||||||
var O = toIObject(object);
|
|
||||||
var i = 0;
|
|
||||||
var result = [];
|
|
||||||
var key;
|
|
||||||
for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
|
|
||||||
// Don't enum bug & hidden keys
|
|
||||||
while (names.length > i) if (has(O, key = names[i++])) {
|
|
||||||
~arrayIndexOf(result, key) || result.push(key);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "7cfd":
|
/***/ "7cfd":
|
||||||
@ -1310,44 +1010,6 @@ NAME in FProto || __webpack_require__("f9a5") && dP(FProto, NAME, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "7d56":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
|
|
||||||
var $keys = __webpack_require__("7afe");
|
|
||||||
var enumBugKeys = __webpack_require__("d93f");
|
|
||||||
|
|
||||||
module.exports = Object.keys || function keys(O) {
|
|
||||||
return $keys(O, enumBugKeys);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "8451":
|
|
||||||
/***/ (function(module, exports) {
|
|
||||||
|
|
||||||
module.exports = function (it) {
|
|
||||||
if (typeof it != 'function') throw TypeError(it + ' is not a function!');
|
|
||||||
return it;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "8941":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
// 7.1.15 ToLength
|
|
||||||
var toInteger = __webpack_require__("a6ad");
|
|
||||||
var min = Math.min;
|
|
||||||
module.exports = function (it) {
|
|
||||||
return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "8cac":
|
/***/ "8cac":
|
||||||
@ -1360,93 +1022,6 @@ module.exports = function (it) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "8d69":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
var dP = __webpack_require__("d3d8");
|
|
||||||
var anObject = __webpack_require__("8cac");
|
|
||||||
var getKeys = __webpack_require__("7d56");
|
|
||||||
|
|
||||||
module.exports = __webpack_require__("f9a5") ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
||||||
anObject(O);
|
|
||||||
var keys = getKeys(Properties);
|
|
||||||
var length = keys.length;
|
|
||||||
var i = 0;
|
|
||||||
var P;
|
|
||||||
while (length > i) dP.f(O, P = keys[i++], Properties[P]);
|
|
||||||
return O;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "96dd":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var addToUnscopables = __webpack_require__("ab19");
|
|
||||||
var step = __webpack_require__("c8e9");
|
|
||||||
var Iterators = __webpack_require__("e3b3");
|
|
||||||
var toIObject = __webpack_require__("6117");
|
|
||||||
|
|
||||||
// 22.1.3.4 Array.prototype.entries()
|
|
||||||
// 22.1.3.13 Array.prototype.keys()
|
|
||||||
// 22.1.3.29 Array.prototype.values()
|
|
||||||
// 22.1.3.30 Array.prototype[@@iterator]()
|
|
||||||
module.exports = __webpack_require__("4aef")(Array, 'Array', function (iterated, kind) {
|
|
||||||
this._t = toIObject(iterated); // target
|
|
||||||
this._i = 0; // next index
|
|
||||||
this._k = kind; // kind
|
|
||||||
// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
|
|
||||||
}, function () {
|
|
||||||
var O = this._t;
|
|
||||||
var kind = this._k;
|
|
||||||
var index = this._i++;
|
|
||||||
if (!O || index >= O.length) {
|
|
||||||
this._t = undefined;
|
|
||||||
return step(1);
|
|
||||||
}
|
|
||||||
if (kind == 'keys') return step(0, index);
|
|
||||||
if (kind == 'values') return step(0, O[index]);
|
|
||||||
return step(0, [index, O[index]]);
|
|
||||||
}, 'values');
|
|
||||||
|
|
||||||
// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
|
|
||||||
Iterators.Arguments = Iterators.Array;
|
|
||||||
|
|
||||||
addToUnscopables('keys');
|
|
||||||
addToUnscopables('values');
|
|
||||||
addToUnscopables('entries');
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "9947":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
var shared = __webpack_require__("f341")('keys');
|
|
||||||
var uid = __webpack_require__("4d2c");
|
|
||||||
module.exports = function (key) {
|
|
||||||
return shared[key] || (shared[key] = uid(key));
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "9952":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
||||||
var cof = __webpack_require__("6077");
|
|
||||||
// eslint-disable-next-line no-prototype-builtins
|
|
||||||
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
|
|
||||||
return cof(it) == 'String' ? it.split('') : Object(it);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "9f7e":
|
/***/ "9f7e":
|
||||||
@ -1459,19 +1034,6 @@ if (__webpack_require__("f9a5") && /./g.flags != 'g') __webpack_require__("d3d8"
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "a6ad":
|
|
||||||
/***/ (function(module, exports) {
|
|
||||||
|
|
||||||
// 7.1.4 ToInteger
|
|
||||||
var ceil = Math.ceil;
|
|
||||||
var floor = Math.floor;
|
|
||||||
module.exports = function (it) {
|
|
||||||
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "a6d5":
|
/***/ "a6d5":
|
||||||
@ -1510,32 +1072,6 @@ __webpack_require__("da27").inspectSource = function (it) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "a9cf":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
// 7.1.13 ToObject(argument)
|
|
||||||
var defined = __webpack_require__("3038");
|
|
||||||
module.exports = function (it) {
|
|
||||||
return Object(defined(it));
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "ab19":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
// 22.1.3.31 Array.prototype[@@unscopables]
|
|
||||||
var UNSCOPABLES = __webpack_require__("1277")('unscopables');
|
|
||||||
var ArrayProto = Array.prototype;
|
|
||||||
if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__("b8ea")(ArrayProto, UNSCOPABLES, {});
|
|
||||||
module.exports = function (key) {
|
|
||||||
ArrayProto[UNSCOPABLES][key] = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "b8ea":
|
/***/ "b8ea":
|
||||||
@ -1551,51 +1087,6 @@ module.exports = __webpack_require__("f9a5") ? function (object, key, value) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "c264":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var create = __webpack_require__("65c3");
|
|
||||||
var descriptor = __webpack_require__("0614");
|
|
||||||
var setToStringTag = __webpack_require__("3d87");
|
|
||||||
var IteratorPrototype = {};
|
|
||||||
|
|
||||||
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
|
|
||||||
__webpack_require__("b8ea")(IteratorPrototype, __webpack_require__("1277")('iterator'), function () { return this; });
|
|
||||||
|
|
||||||
module.exports = function (Constructor, NAME, next) {
|
|
||||||
Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
|
|
||||||
setToStringTag(Constructor, NAME + ' Iterator');
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "c3a9":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
var toInteger = __webpack_require__("a6ad");
|
|
||||||
var max = Math.max;
|
|
||||||
var min = Math.min;
|
|
||||||
module.exports = function (index, length) {
|
|
||||||
index = toInteger(index);
|
|
||||||
return index < 0 ? max(index + length, 0) : min(index, length);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "c8e9":
|
|
||||||
/***/ (function(module, exports) {
|
|
||||||
|
|
||||||
module.exports = function (done, value) {
|
|
||||||
return { value: value, done: !!done };
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "cc1d":
|
/***/ "cc1d":
|
||||||
@ -1629,26 +1120,6 @@ if (__webpack_require__("0cc1")(function () { return $toString.call({ source: 'a
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "d15b":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
|
|
||||||
var has = __webpack_require__("549d");
|
|
||||||
var toObject = __webpack_require__("a9cf");
|
|
||||||
var IE_PROTO = __webpack_require__("9947")('IE_PROTO');
|
|
||||||
var ObjectProto = Object.prototype;
|
|
||||||
|
|
||||||
module.exports = Object.getPrototypeOf || function (O) {
|
|
||||||
O = toObject(O);
|
|
||||||
if (has(O, IE_PROTO)) return O[IE_PROTO];
|
|
||||||
if (typeof O.constructor == 'function' && O instanceof O.constructor) {
|
|
||||||
return O.constructor.prototype;
|
|
||||||
} return O instanceof Object ? ObjectProto : null;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "d3d8":
|
/***/ "d3d8":
|
||||||
@ -1672,17 +1143,6 @@ exports.f = __webpack_require__("f9a5") ? Object.defineProperty : function defin
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "d93f":
|
|
||||||
/***/ (function(module, exports) {
|
|
||||||
|
|
||||||
// IE 8- don't enum bug keys
|
|
||||||
module.exports = (
|
|
||||||
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
|
|
||||||
).split(',');
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "da0b":
|
/***/ "da0b":
|
||||||
@ -1702,14 +1162,6 @@ var core = module.exports = { version: '2.6.10' };
|
|||||||
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
|
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "e3b3":
|
|
||||||
/***/ (function(module, exports) {
|
|
||||||
|
|
||||||
module.exports = {};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "e67d":
|
/***/ "e67d":
|
||||||
@ -1774,33 +1226,6 @@ module.exports = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "e85e":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
// optional / simple context binding
|
|
||||||
var aFunction = __webpack_require__("8451");
|
|
||||||
module.exports = function (fn, that, length) {
|
|
||||||
aFunction(fn);
|
|
||||||
if (that === undefined) return fn;
|
|
||||||
switch (length) {
|
|
||||||
case 1: return function (a) {
|
|
||||||
return fn.call(that, a);
|
|
||||||
};
|
|
||||||
case 2: return function (a, b) {
|
|
||||||
return fn.call(that, a, b);
|
|
||||||
};
|
|
||||||
case 3: return function (a, b, c) {
|
|
||||||
return fn.call(that, a, b, c);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return function (/* ...args */) {
|
|
||||||
return fn.apply(that, arguments);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "f341":
|
/***/ "f341":
|
||||||
|
@ -151,16 +151,29 @@ if (typeof window !== 'undefined') {
|
|||||||
// EXTERNAL MODULE: ./node_modules/_core-js@2.6.10@core-js/modules/es6.function.name.js
|
// EXTERNAL MODULE: ./node_modules/_core-js@2.6.10@core-js/modules/es6.function.name.js
|
||||||
var es6_function_name = __webpack_require__("7cfd");
|
var es6_function_name = __webpack_require__("7cfd");
|
||||||
|
|
||||||
// CONCATENATED MODULE: ./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"05d0d90a-vue-loader-template"}!./node_modules/_vue-loader@15.7.2@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.7.2@vue-loader/lib??vue-loader-options!./packages/AliplayerV2/index.vue?vue&type=template&id=d74f17bc&
|
// CONCATENATED MODULE: ./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"05d0d90a-vue-loader-template"}!./node_modules/_vue-loader@15.7.2@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!./node_modules/_vue-loader@15.7.2@vue-loader/lib??vue-loader-options!./packages/AliplayerV2/index.vue?vue&type=template&id=c8a41478&
|
||||||
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":_vm.playerId}})}
|
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":_vm.playerId}})}
|
||||||
var staticRenderFns = []
|
var staticRenderFns = []
|
||||||
|
|
||||||
|
|
||||||
// CONCATENATED MODULE: ./packages/AliplayerV2/index.vue?vue&type=template&id=d74f17bc&
|
// CONCATENATED MODULE: ./packages/AliplayerV2/index.vue?vue&type=template&id=c8a41478&
|
||||||
|
|
||||||
// EXTERNAL MODULE: ./node_modules/_core-js@2.6.10@core-js/modules/web.dom.iterable.js
|
// CONCATENATED MODULE: ./node_modules/_@babel_runtime@7.7.2@@babel/runtime/helpers/esm/typeof.js
|
||||||
var web_dom_iterable = __webpack_require__("4634");
|
function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
|
||||||
|
|
||||||
|
function _typeof(obj) {
|
||||||
|
if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") {
|
||||||
|
_typeof = function _typeof(obj) {
|
||||||
|
return _typeof2(obj);
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
_typeof = function _typeof(obj) {
|
||||||
|
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return _typeof(obj);
|
||||||
|
}
|
||||||
// EXTERNAL MODULE: ./node_modules/_core-js@2.6.10@core-js/modules/es6.regexp.to-string.js
|
// EXTERNAL MODULE: ./node_modules/_core-js@2.6.10@core-js/modules/es6.regexp.to-string.js
|
||||||
var es6_regexp_to_string = __webpack_require__("cc1d");
|
var es6_regexp_to_string = __webpack_require__("cc1d");
|
||||||
|
|
||||||
@ -173,6 +186,12 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
|
|||||||
/* harmony default export */ var AliplayerV2vue_type_script_lang_js_ = ({
|
/* harmony default export */ var AliplayerV2vue_type_script_lang_js_ = ({
|
||||||
name: 'VueAliplayerV2',
|
name: 'VueAliplayerV2',
|
||||||
props: {
|
props: {
|
||||||
|
forbidFastForward: {
|
||||||
|
//禁止拖拽快进
|
||||||
|
required: false,
|
||||||
|
type: [Boolean],
|
||||||
|
default: false
|
||||||
|
},
|
||||||
options: {
|
options: {
|
||||||
//配置项
|
//配置项
|
||||||
required: false,
|
required: false,
|
||||||
@ -191,13 +210,13 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
|
|||||||
//css版本源
|
//css版本源
|
||||||
required: false,
|
required: false,
|
||||||
type: [String],
|
type: [String],
|
||||||
default: "https://g.alicdn.com/de/prismplayer/2.9.0/skins/default/aliplayer-min.css"
|
default: "https://g.alicdn.com/de/prismplayer/2.9.20/skins/default/aliplayer-min.css"
|
||||||
},
|
},
|
||||||
scriptSrc: {
|
scriptSrc: {
|
||||||
//js版本源
|
//js版本源
|
||||||
required: false,
|
required: false,
|
||||||
type: [String],
|
type: [String],
|
||||||
default: "https://g.alicdn.com/de/prismplayer/2.9.0/aliplayer-min.js"
|
default: "https://g.alicdn.com/de/prismplayer/2.9.20/aliplayer-min.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data: function data() {
|
data: function data() {
|
||||||
@ -300,6 +319,9 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
|
|||||||
//监听播放源变化
|
//监听播放源变化
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
|
forbidFastForward: function forbidFastForward() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
options: {
|
options: {
|
||||||
//配置项是对象,只能深度监听
|
//配置项是对象,只能深度监听
|
||||||
handler: function handler() {
|
handler: function handler() {
|
||||||
@ -324,6 +346,8 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handlerFastForward: function handlerFastForward() {},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建script和css
|
* 创建script和css
|
||||||
* 加载Alipayer的SDK
|
* 加载Alipayer的SDK
|
||||||
@ -331,8 +355,8 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
|
|||||||
init: function init() {
|
init: function init() {
|
||||||
var _this3 = this;
|
var _this3 = this;
|
||||||
|
|
||||||
var linkID = 'aliplayer-min-css';
|
var linkID = 'app__aliplayer-min-css';
|
||||||
var scriptID = 'aliplayer-min-js';
|
var scriptID = 'app__aliplayer-min-js';
|
||||||
var head = document.getElementsByTagName('head');
|
var head = document.getElementsByTagName('head');
|
||||||
var html = document.getElementsByTagName('html');
|
var html = document.getElementsByTagName('html');
|
||||||
var scriptTag = document.getElementById(scriptID);
|
var scriptTag = document.getElementById(scriptID);
|
||||||
@ -344,7 +368,8 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
|
|||||||
link.type = 'text/css';
|
link.type = 'text/css';
|
||||||
link.rel = 'stylesheet';
|
link.rel = 'stylesheet';
|
||||||
link.href = this.cssLink;
|
link.href = this.cssLink;
|
||||||
link.id = linkID;
|
link.id = linkID; // link.className = linkID;
|
||||||
|
|
||||||
head[0].appendChild(link);
|
head[0].appendChild(link);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -352,7 +377,8 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
|
|||||||
// console.log('scriptTag');
|
// console.log('scriptTag');
|
||||||
scriptTag = document.createElement('script');
|
scriptTag = document.createElement('script');
|
||||||
scriptTag.type = "text/javascript";
|
scriptTag.type = "text/javascript";
|
||||||
scriptTag.id = scriptID;
|
scriptTag.id = scriptID; // scriptTag.className = scriptID;
|
||||||
|
|
||||||
scriptTag.src = this.scriptSrc;
|
scriptTag.src = this.scriptSrc;
|
||||||
html[0].appendChild(scriptTag);
|
html[0].appendChild(scriptTag);
|
||||||
} else {
|
} else {
|
||||||
@ -373,7 +399,7 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
|
|||||||
var _this4 = this;
|
var _this4 = this;
|
||||||
|
|
||||||
if (typeof window.Aliplayer != 'undefined') {
|
if (typeof window.Aliplayer != 'undefined') {
|
||||||
var options = this.options;
|
var options = this.deepCloneObject(this.options);
|
||||||
|
|
||||||
if (options) {
|
if (options) {
|
||||||
for (var key in options) {
|
for (var key in options) {
|
||||||
@ -398,6 +424,25 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
|
|||||||
|
|
||||||
for (var ev in this.events) {
|
for (var ev in this.events) {
|
||||||
_loop(ev);
|
_loop(ev);
|
||||||
|
} //开启禁止拖拽快进
|
||||||
|
|
||||||
|
|
||||||
|
if (this.forbidFastForward) {
|
||||||
|
var last = 0,
|
||||||
|
max_time = 0;
|
||||||
|
this.player.on('timeupdate', function () {
|
||||||
|
var current = this.getCurrentTime();
|
||||||
|
|
||||||
|
if (current - last > 2) {
|
||||||
|
this.seek(last);
|
||||||
|
} else {
|
||||||
|
last = current;
|
||||||
|
|
||||||
|
if (last >= max_time) {
|
||||||
|
max_time = last;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
} //通过播放器实例的off方法取消订阅
|
} //通过播放器实例的off方法取消订阅
|
||||||
//player.off('ready',handleReady);
|
//player.off('ready',handleReady);
|
||||||
|
|
||||||
@ -677,18 +722,45 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
|
|||||||
*/
|
*/
|
||||||
off: function off(ev, handle) {
|
off: function off(ev, handle) {
|
||||||
this.player && this.player.off(ev, handle);
|
this.player && this.player.off(ev, handle);
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 深度拷贝
|
||||||
|
* @param {*} obj
|
||||||
|
*/
|
||||||
|
deepCloneObject: function deepCloneObject(obj) {
|
||||||
|
var objClone = Array.isArray(obj) ? [] : {};
|
||||||
|
|
||||||
|
if (obj && _typeof(obj) === 'object') {
|
||||||
|
for (var key in obj) {
|
||||||
|
if (obj.hasOwnProperty(key)) {
|
||||||
|
//判断ojb子元素是否为对象,如果是,递归复制
|
||||||
|
if (obj[key] && _typeof(obj[key]) === 'object') {
|
||||||
|
objClone[key] = this.deepCloneObject(obj[key]);
|
||||||
|
} else {
|
||||||
|
//如果不是,简单复制
|
||||||
|
objClone[key] = obj[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return objClone;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy: function beforeDestroy() {
|
beforeDestroy: function beforeDestroy() {
|
||||||
//防止重复创建
|
//防止重复创建
|
||||||
this.dispose(); //销毁播放器(防止直播播放的情况下,播放器已经销毁,而后台还在继续下载资源造成卡顿的bug)
|
this.dispose(); //销毁播放器(防止直播播放的情况下,播放器已经销毁,而后台还在继续下载资源造成卡顿的bug)
|
||||||
|
// const head = document.querySelector('head');
|
||||||
var head = document.querySelector('head'); //移除所有的重复创建的标签
|
// const cssNodes = document.querySelectorAll(`link.app__aliplayer-min-css`);
|
||||||
|
// (html && cssNodes.length > 1) && cssNodes.forEach((item, index)=>{
|
||||||
var nodes = document.querySelectorAll('script[src="https://g.alicdn.com/de/prismplayer/2.8.2/hls/aliplayer-hls-min.js"]');
|
// if(index != 0) head.removeChild(item);
|
||||||
head && nodes.forEach(function (item) {
|
// });
|
||||||
head.removeChild(item);
|
// const html = document.querySelector('html');
|
||||||
});
|
// const jsNodes = document.querySelectorAll(`script.app__aliplayer-min-js`);
|
||||||
|
// (html && jsNodes.length > 1) && jsNodes.forEach((item, index)=>{
|
||||||
|
// if(index != 0) html.removeChild(item);
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// CONCATENATED MODULE: ./packages/AliplayerV2/index.vue?vue&type=script&lang=js&
|
// CONCATENATED MODULE: ./packages/AliplayerV2/index.vue?vue&type=script&lang=js&
|
||||||
@ -829,113 +901,6 @@ AliplayerV2.Player = AliplayerV2;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "1277":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
var store = __webpack_require__("f341")('wks');
|
|
||||||
var uid = __webpack_require__("4d2c");
|
|
||||||
var Symbol = __webpack_require__("3f8b").Symbol;
|
|
||||||
var USE_SYMBOL = typeof Symbol == 'function';
|
|
||||||
|
|
||||||
var $exports = module.exports = function (name) {
|
|
||||||
return store[name] || (store[name] =
|
|
||||||
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
|
|
||||||
};
|
|
||||||
|
|
||||||
$exports.store = store;
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "17cb":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
var document = __webpack_require__("3f8b").document;
|
|
||||||
module.exports = document && document.documentElement;
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "1f9e":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
// false -> Array#indexOf
|
|
||||||
// true -> Array#includes
|
|
||||||
var toIObject = __webpack_require__("6117");
|
|
||||||
var toLength = __webpack_require__("8941");
|
|
||||||
var toAbsoluteIndex = __webpack_require__("c3a9");
|
|
||||||
module.exports = function (IS_INCLUDES) {
|
|
||||||
return function ($this, el, fromIndex) {
|
|
||||||
var O = toIObject($this);
|
|
||||||
var length = toLength(O.length);
|
|
||||||
var index = toAbsoluteIndex(fromIndex, length);
|
|
||||||
var value;
|
|
||||||
// Array#includes uses SameValueZero equality algorithm
|
|
||||||
// eslint-disable-next-line no-self-compare
|
|
||||||
if (IS_INCLUDES && el != el) while (length > index) {
|
|
||||||
value = O[index++];
|
|
||||||
// eslint-disable-next-line no-self-compare
|
|
||||||
if (value != value) return true;
|
|
||||||
// Array#indexOf ignores holes, Array#includes - not
|
|
||||||
} else for (;length > index; index++) if (IS_INCLUDES || index in O) {
|
|
||||||
if (O[index] === el) return IS_INCLUDES || index || 0;
|
|
||||||
} return !IS_INCLUDES && -1;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "2498":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
var global = __webpack_require__("3f8b");
|
|
||||||
var core = __webpack_require__("da27");
|
|
||||||
var hide = __webpack_require__("b8ea");
|
|
||||||
var redefine = __webpack_require__("a6d5");
|
|
||||||
var ctx = __webpack_require__("e85e");
|
|
||||||
var PROTOTYPE = 'prototype';
|
|
||||||
|
|
||||||
var $export = function (type, name, source) {
|
|
||||||
var IS_FORCED = type & $export.F;
|
|
||||||
var IS_GLOBAL = type & $export.G;
|
|
||||||
var IS_STATIC = type & $export.S;
|
|
||||||
var IS_PROTO = type & $export.P;
|
|
||||||
var IS_BIND = type & $export.B;
|
|
||||||
var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];
|
|
||||||
var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
|
|
||||||
var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
|
|
||||||
var key, own, out, exp;
|
|
||||||
if (IS_GLOBAL) source = name;
|
|
||||||
for (key in source) {
|
|
||||||
// contains in native
|
|
||||||
own = !IS_FORCED && target && target[key] !== undefined;
|
|
||||||
// export native or passed
|
|
||||||
out = (own ? target : source)[key];
|
|
||||||
// bind timers to global for call from export context
|
|
||||||
exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
|
|
||||||
// extend global
|
|
||||||
if (target) redefine(target, key, out, type & $export.U);
|
|
||||||
// export
|
|
||||||
if (exports[key] != out) hide(exports, key, exp);
|
|
||||||
if (IS_PROTO && expProto[key] != out) expProto[key] = out;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
global.core = core;
|
|
||||||
// type bitmap
|
|
||||||
$export.F = 1; // forced
|
|
||||||
$export.G = 2; // global
|
|
||||||
$export.S = 4; // static
|
|
||||||
$export.P = 8; // proto
|
|
||||||
$export.B = 16; // bind
|
|
||||||
$export.W = 32; // wrap
|
|
||||||
$export.U = 64; // safe
|
|
||||||
$export.R = 128; // real proto method for `library`
|
|
||||||
module.exports = $export;
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "25ae":
|
/***/ "25ae":
|
||||||
@ -965,32 +930,6 @@ module.exports = function (it, S) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "3038":
|
|
||||||
/***/ (function(module, exports) {
|
|
||||||
|
|
||||||
// 7.2.1 RequireObjectCoercible(argument)
|
|
||||||
module.exports = function (it) {
|
|
||||||
if (it == undefined) throw TypeError("Can't call method on " + it);
|
|
||||||
return it;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "3d87":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
var def = __webpack_require__("d3d8").f;
|
|
||||||
var has = __webpack_require__("549d");
|
|
||||||
var TAG = __webpack_require__("1277")('toStringTag');
|
|
||||||
|
|
||||||
module.exports = function (it, tag, stat) {
|
|
||||||
if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "3f8b":
|
/***/ "3f8b":
|
||||||
@ -1004,148 +943,6 @@ var global = module.exports = typeof window != 'undefined' && window.Math == Mat
|
|||||||
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
|
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "4634":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
var $iterators = __webpack_require__("96dd");
|
|
||||||
var getKeys = __webpack_require__("7d56");
|
|
||||||
var redefine = __webpack_require__("a6d5");
|
|
||||||
var global = __webpack_require__("3f8b");
|
|
||||||
var hide = __webpack_require__("b8ea");
|
|
||||||
var Iterators = __webpack_require__("e3b3");
|
|
||||||
var wks = __webpack_require__("1277");
|
|
||||||
var ITERATOR = wks('iterator');
|
|
||||||
var TO_STRING_TAG = wks('toStringTag');
|
|
||||||
var ArrayValues = Iterators.Array;
|
|
||||||
|
|
||||||
var DOMIterables = {
|
|
||||||
CSSRuleList: true, // TODO: Not spec compliant, should be false.
|
|
||||||
CSSStyleDeclaration: false,
|
|
||||||
CSSValueList: false,
|
|
||||||
ClientRectList: false,
|
|
||||||
DOMRectList: false,
|
|
||||||
DOMStringList: false,
|
|
||||||
DOMTokenList: true,
|
|
||||||
DataTransferItemList: false,
|
|
||||||
FileList: false,
|
|
||||||
HTMLAllCollection: false,
|
|
||||||
HTMLCollection: false,
|
|
||||||
HTMLFormElement: false,
|
|
||||||
HTMLSelectElement: false,
|
|
||||||
MediaList: true, // TODO: Not spec compliant, should be false.
|
|
||||||
MimeTypeArray: false,
|
|
||||||
NamedNodeMap: false,
|
|
||||||
NodeList: true,
|
|
||||||
PaintRequestList: false,
|
|
||||||
Plugin: false,
|
|
||||||
PluginArray: false,
|
|
||||||
SVGLengthList: false,
|
|
||||||
SVGNumberList: false,
|
|
||||||
SVGPathSegList: false,
|
|
||||||
SVGPointList: false,
|
|
||||||
SVGStringList: false,
|
|
||||||
SVGTransformList: false,
|
|
||||||
SourceBufferList: false,
|
|
||||||
StyleSheetList: true, // TODO: Not spec compliant, should be false.
|
|
||||||
TextTrackCueList: false,
|
|
||||||
TextTrackList: false,
|
|
||||||
TouchList: false
|
|
||||||
};
|
|
||||||
|
|
||||||
for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {
|
|
||||||
var NAME = collections[i];
|
|
||||||
var explicit = DOMIterables[NAME];
|
|
||||||
var Collection = global[NAME];
|
|
||||||
var proto = Collection && Collection.prototype;
|
|
||||||
var key;
|
|
||||||
if (proto) {
|
|
||||||
if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);
|
|
||||||
if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
|
|
||||||
Iterators[NAME] = ArrayValues;
|
|
||||||
if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "4aef":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var LIBRARY = __webpack_require__("6cc2");
|
|
||||||
var $export = __webpack_require__("2498");
|
|
||||||
var redefine = __webpack_require__("a6d5");
|
|
||||||
var hide = __webpack_require__("b8ea");
|
|
||||||
var Iterators = __webpack_require__("e3b3");
|
|
||||||
var $iterCreate = __webpack_require__("c264");
|
|
||||||
var setToStringTag = __webpack_require__("3d87");
|
|
||||||
var getPrototypeOf = __webpack_require__("d15b");
|
|
||||||
var ITERATOR = __webpack_require__("1277")('iterator');
|
|
||||||
var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
|
|
||||||
var FF_ITERATOR = '@@iterator';
|
|
||||||
var KEYS = 'keys';
|
|
||||||
var VALUES = 'values';
|
|
||||||
|
|
||||||
var returnThis = function () { return this; };
|
|
||||||
|
|
||||||
module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
|
|
||||||
$iterCreate(Constructor, NAME, next);
|
|
||||||
var getMethod = function (kind) {
|
|
||||||
if (!BUGGY && kind in proto) return proto[kind];
|
|
||||||
switch (kind) {
|
|
||||||
case KEYS: return function keys() { return new Constructor(this, kind); };
|
|
||||||
case VALUES: return function values() { return new Constructor(this, kind); };
|
|
||||||
} return function entries() { return new Constructor(this, kind); };
|
|
||||||
};
|
|
||||||
var TAG = NAME + ' Iterator';
|
|
||||||
var DEF_VALUES = DEFAULT == VALUES;
|
|
||||||
var VALUES_BUG = false;
|
|
||||||
var proto = Base.prototype;
|
|
||||||
var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
|
|
||||||
var $default = $native || getMethod(DEFAULT);
|
|
||||||
var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
|
|
||||||
var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
|
|
||||||
var methods, key, IteratorPrototype;
|
|
||||||
// Fix native
|
|
||||||
if ($anyNative) {
|
|
||||||
IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
|
|
||||||
if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
|
|
||||||
// Set @@toStringTag to native iterators
|
|
||||||
setToStringTag(IteratorPrototype, TAG, true);
|
|
||||||
// fix for some old engines
|
|
||||||
if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// fix Array#{values, @@iterator}.name in V8 / FF
|
|
||||||
if (DEF_VALUES && $native && $native.name !== VALUES) {
|
|
||||||
VALUES_BUG = true;
|
|
||||||
$default = function values() { return $native.call(this); };
|
|
||||||
}
|
|
||||||
// Define iterator
|
|
||||||
if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
|
|
||||||
hide(proto, ITERATOR, $default);
|
|
||||||
}
|
|
||||||
// Plug for library
|
|
||||||
Iterators[NAME] = $default;
|
|
||||||
Iterators[TAG] = returnThis;
|
|
||||||
if (DEFAULT) {
|
|
||||||
methods = {
|
|
||||||
values: DEF_VALUES ? $default : getMethod(VALUES),
|
|
||||||
keys: IS_SET ? $default : getMethod(KEYS),
|
|
||||||
entries: $entries
|
|
||||||
};
|
|
||||||
if (FORCED) for (key in methods) {
|
|
||||||
if (!(key in proto)) redefine(proto, key, methods[key]);
|
|
||||||
} else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
|
|
||||||
}
|
|
||||||
return methods;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "4d2c":
|
/***/ "4d2c":
|
||||||
@ -1169,79 +966,6 @@ module.exports = function (it, key) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "6077":
|
|
||||||
/***/ (function(module, exports) {
|
|
||||||
|
|
||||||
var toString = {}.toString;
|
|
||||||
|
|
||||||
module.exports = function (it) {
|
|
||||||
return toString.call(it).slice(8, -1);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "6117":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
// to indexed object, toObject with fallback for non-array-like ES3 strings
|
|
||||||
var IObject = __webpack_require__("9952");
|
|
||||||
var defined = __webpack_require__("3038");
|
|
||||||
module.exports = function (it) {
|
|
||||||
return IObject(defined(it));
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "65c3":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
|
|
||||||
var anObject = __webpack_require__("8cac");
|
|
||||||
var dPs = __webpack_require__("8d69");
|
|
||||||
var enumBugKeys = __webpack_require__("d93f");
|
|
||||||
var IE_PROTO = __webpack_require__("9947")('IE_PROTO');
|
|
||||||
var Empty = function () { /* empty */ };
|
|
||||||
var PROTOTYPE = 'prototype';
|
|
||||||
|
|
||||||
// Create object with fake `null` prototype: use iframe Object with cleared prototype
|
|
||||||
var createDict = function () {
|
|
||||||
// Thrash, waste and sodomy: IE GC bug
|
|
||||||
var iframe = __webpack_require__("6618")('iframe');
|
|
||||||
var i = enumBugKeys.length;
|
|
||||||
var lt = '<';
|
|
||||||
var gt = '>';
|
|
||||||
var iframeDocument;
|
|
||||||
iframe.style.display = 'none';
|
|
||||||
__webpack_require__("17cb").appendChild(iframe);
|
|
||||||
iframe.src = 'javascript:'; // eslint-disable-line no-script-url
|
|
||||||
// createDict = iframe.contentWindow.Object;
|
|
||||||
// html.removeChild(iframe);
|
|
||||||
iframeDocument = iframe.contentWindow.document;
|
|
||||||
iframeDocument.open();
|
|
||||||
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
|
|
||||||
iframeDocument.close();
|
|
||||||
createDict = iframeDocument.F;
|
|
||||||
while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
|
|
||||||
return createDict();
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = Object.create || function create(O, Properties) {
|
|
||||||
var result;
|
|
||||||
if (O !== null) {
|
|
||||||
Empty[PROTOTYPE] = anObject(O);
|
|
||||||
result = new Empty();
|
|
||||||
Empty[PROTOTYPE] = null;
|
|
||||||
// add "__proto__" for Object.getPrototypeOf polyfill
|
|
||||||
result[IE_PROTO] = O;
|
|
||||||
} else result = createDict();
|
|
||||||
return Properties === undefined ? result : dPs(result, Properties);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "6618":
|
/***/ "6618":
|
||||||
@ -1272,30 +996,6 @@ module.exports = false;
|
|||||||
module.exports = __webpack_require__("f341")('native-function-to-string', Function.toString);
|
module.exports = __webpack_require__("f341")('native-function-to-string', Function.toString);
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "7afe":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
var has = __webpack_require__("549d");
|
|
||||||
var toIObject = __webpack_require__("6117");
|
|
||||||
var arrayIndexOf = __webpack_require__("1f9e")(false);
|
|
||||||
var IE_PROTO = __webpack_require__("9947")('IE_PROTO');
|
|
||||||
|
|
||||||
module.exports = function (object, names) {
|
|
||||||
var O = toIObject(object);
|
|
||||||
var i = 0;
|
|
||||||
var result = [];
|
|
||||||
var key;
|
|
||||||
for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
|
|
||||||
// Don't enum bug & hidden keys
|
|
||||||
while (names.length > i) if (has(O, key = names[i++])) {
|
|
||||||
~arrayIndexOf(result, key) || result.push(key);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "7cfd":
|
/***/ "7cfd":
|
||||||
@ -1319,44 +1019,6 @@ NAME in FProto || __webpack_require__("f9a5") && dP(FProto, NAME, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "7d56":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
|
|
||||||
var $keys = __webpack_require__("7afe");
|
|
||||||
var enumBugKeys = __webpack_require__("d93f");
|
|
||||||
|
|
||||||
module.exports = Object.keys || function keys(O) {
|
|
||||||
return $keys(O, enumBugKeys);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "8451":
|
|
||||||
/***/ (function(module, exports) {
|
|
||||||
|
|
||||||
module.exports = function (it) {
|
|
||||||
if (typeof it != 'function') throw TypeError(it + ' is not a function!');
|
|
||||||
return it;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "8941":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
// 7.1.15 ToLength
|
|
||||||
var toInteger = __webpack_require__("a6ad");
|
|
||||||
var min = Math.min;
|
|
||||||
module.exports = function (it) {
|
|
||||||
return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "8cac":
|
/***/ "8cac":
|
||||||
@ -1369,93 +1031,6 @@ module.exports = function (it) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "8d69":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
var dP = __webpack_require__("d3d8");
|
|
||||||
var anObject = __webpack_require__("8cac");
|
|
||||||
var getKeys = __webpack_require__("7d56");
|
|
||||||
|
|
||||||
module.exports = __webpack_require__("f9a5") ? Object.defineProperties : function defineProperties(O, Properties) {
|
|
||||||
anObject(O);
|
|
||||||
var keys = getKeys(Properties);
|
|
||||||
var length = keys.length;
|
|
||||||
var i = 0;
|
|
||||||
var P;
|
|
||||||
while (length > i) dP.f(O, P = keys[i++], Properties[P]);
|
|
||||||
return O;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "96dd":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var addToUnscopables = __webpack_require__("ab19");
|
|
||||||
var step = __webpack_require__("c8e9");
|
|
||||||
var Iterators = __webpack_require__("e3b3");
|
|
||||||
var toIObject = __webpack_require__("6117");
|
|
||||||
|
|
||||||
// 22.1.3.4 Array.prototype.entries()
|
|
||||||
// 22.1.3.13 Array.prototype.keys()
|
|
||||||
// 22.1.3.29 Array.prototype.values()
|
|
||||||
// 22.1.3.30 Array.prototype[@@iterator]()
|
|
||||||
module.exports = __webpack_require__("4aef")(Array, 'Array', function (iterated, kind) {
|
|
||||||
this._t = toIObject(iterated); // target
|
|
||||||
this._i = 0; // next index
|
|
||||||
this._k = kind; // kind
|
|
||||||
// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
|
|
||||||
}, function () {
|
|
||||||
var O = this._t;
|
|
||||||
var kind = this._k;
|
|
||||||
var index = this._i++;
|
|
||||||
if (!O || index >= O.length) {
|
|
||||||
this._t = undefined;
|
|
||||||
return step(1);
|
|
||||||
}
|
|
||||||
if (kind == 'keys') return step(0, index);
|
|
||||||
if (kind == 'values') return step(0, O[index]);
|
|
||||||
return step(0, [index, O[index]]);
|
|
||||||
}, 'values');
|
|
||||||
|
|
||||||
// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
|
|
||||||
Iterators.Arguments = Iterators.Array;
|
|
||||||
|
|
||||||
addToUnscopables('keys');
|
|
||||||
addToUnscopables('values');
|
|
||||||
addToUnscopables('entries');
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "9947":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
var shared = __webpack_require__("f341")('keys');
|
|
||||||
var uid = __webpack_require__("4d2c");
|
|
||||||
module.exports = function (key) {
|
|
||||||
return shared[key] || (shared[key] = uid(key));
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "9952":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
||||||
var cof = __webpack_require__("6077");
|
|
||||||
// eslint-disable-next-line no-prototype-builtins
|
|
||||||
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
|
|
||||||
return cof(it) == 'String' ? it.split('') : Object(it);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "9f7e":
|
/***/ "9f7e":
|
||||||
@ -1468,19 +1043,6 @@ if (__webpack_require__("f9a5") && /./g.flags != 'g') __webpack_require__("d3d8"
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "a6ad":
|
|
||||||
/***/ (function(module, exports) {
|
|
||||||
|
|
||||||
// 7.1.4 ToInteger
|
|
||||||
var ceil = Math.ceil;
|
|
||||||
var floor = Math.floor;
|
|
||||||
module.exports = function (it) {
|
|
||||||
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "a6d5":
|
/***/ "a6d5":
|
||||||
@ -1519,32 +1081,6 @@ __webpack_require__("da27").inspectSource = function (it) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "a9cf":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
// 7.1.13 ToObject(argument)
|
|
||||||
var defined = __webpack_require__("3038");
|
|
||||||
module.exports = function (it) {
|
|
||||||
return Object(defined(it));
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "ab19":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
// 22.1.3.31 Array.prototype[@@unscopables]
|
|
||||||
var UNSCOPABLES = __webpack_require__("1277")('unscopables');
|
|
||||||
var ArrayProto = Array.prototype;
|
|
||||||
if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__("b8ea")(ArrayProto, UNSCOPABLES, {});
|
|
||||||
module.exports = function (key) {
|
|
||||||
ArrayProto[UNSCOPABLES][key] = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "b8ea":
|
/***/ "b8ea":
|
||||||
@ -1560,51 +1096,6 @@ module.exports = __webpack_require__("f9a5") ? function (object, key, value) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "c264":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var create = __webpack_require__("65c3");
|
|
||||||
var descriptor = __webpack_require__("0614");
|
|
||||||
var setToStringTag = __webpack_require__("3d87");
|
|
||||||
var IteratorPrototype = {};
|
|
||||||
|
|
||||||
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
|
|
||||||
__webpack_require__("b8ea")(IteratorPrototype, __webpack_require__("1277")('iterator'), function () { return this; });
|
|
||||||
|
|
||||||
module.exports = function (Constructor, NAME, next) {
|
|
||||||
Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
|
|
||||||
setToStringTag(Constructor, NAME + ' Iterator');
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "c3a9":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
var toInteger = __webpack_require__("a6ad");
|
|
||||||
var max = Math.max;
|
|
||||||
var min = Math.min;
|
|
||||||
module.exports = function (index, length) {
|
|
||||||
index = toInteger(index);
|
|
||||||
return index < 0 ? max(index + length, 0) : min(index, length);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "c8e9":
|
|
||||||
/***/ (function(module, exports) {
|
|
||||||
|
|
||||||
module.exports = function (done, value) {
|
|
||||||
return { value: value, done: !!done };
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "cc1d":
|
/***/ "cc1d":
|
||||||
@ -1638,26 +1129,6 @@ if (__webpack_require__("0cc1")(function () { return $toString.call({ source: 'a
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "d15b":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
|
|
||||||
var has = __webpack_require__("549d");
|
|
||||||
var toObject = __webpack_require__("a9cf");
|
|
||||||
var IE_PROTO = __webpack_require__("9947")('IE_PROTO');
|
|
||||||
var ObjectProto = Object.prototype;
|
|
||||||
|
|
||||||
module.exports = Object.getPrototypeOf || function (O) {
|
|
||||||
O = toObject(O);
|
|
||||||
if (has(O, IE_PROTO)) return O[IE_PROTO];
|
|
||||||
if (typeof O.constructor == 'function' && O instanceof O.constructor) {
|
|
||||||
return O.constructor.prototype;
|
|
||||||
} return O instanceof Object ? ObjectProto : null;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "d3d8":
|
/***/ "d3d8":
|
||||||
@ -1681,17 +1152,6 @@ exports.f = __webpack_require__("f9a5") ? Object.defineProperty : function defin
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "d93f":
|
|
||||||
/***/ (function(module, exports) {
|
|
||||||
|
|
||||||
// IE 8- don't enum bug keys
|
|
||||||
module.exports = (
|
|
||||||
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
|
|
||||||
).split(',');
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "da0b":
|
/***/ "da0b":
|
||||||
@ -1711,14 +1171,6 @@ var core = module.exports = { version: '2.6.10' };
|
|||||||
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
|
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "e3b3":
|
|
||||||
/***/ (function(module, exports) {
|
|
||||||
|
|
||||||
module.exports = {};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "e67d":
|
/***/ "e67d":
|
||||||
@ -1783,33 +1235,6 @@ module.exports = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ "e85e":
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
// optional / simple context binding
|
|
||||||
var aFunction = __webpack_require__("8451");
|
|
||||||
module.exports = function (fn, that, length) {
|
|
||||||
aFunction(fn);
|
|
||||||
if (that === undefined) return fn;
|
|
||||||
switch (length) {
|
|
||||||
case 1: return function (a) {
|
|
||||||
return fn.call(that, a);
|
|
||||||
};
|
|
||||||
case 2: return function (a, b) {
|
|
||||||
return fn.call(that, a, b);
|
|
||||||
};
|
|
||||||
case 3: return function (a, b, c) {
|
|
||||||
return fn.call(that, a, b, c);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return function (/* ...args */) {
|
|
||||||
return fn.apply(that, arguments);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "f341":
|
/***/ "f341":
|
||||||
|
2
lib/vue-aliplayer-v2.umd.min.js
vendored
2
lib/vue-aliplayer-v2.umd.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "vue-aliplayer-v2",
|
"name": "vue-aliplayer-v2",
|
||||||
"version": "1.2.5",
|
"version": "1.3.1",
|
||||||
"author": "yxs",
|
"author": "yxs",
|
||||||
"description": "感谢每一位支持开源的朋友. 这是一个基于Alipayer 开发并封装成vue组件的集成播放器.可播放rtmp,m3u8,mp4....视频.除支持直播流与点播的基础功能外,也支持视频的加密播放、清晰度切换、直播时移等业务场景",
|
"description": "感谢每一位支持开源的朋友. 这是一个基于Alipayer 开发并封装成vue组件的集成播放器.可播放rtmp,m3u8,mp4....视频.除支持直播流与点播的基础功能外,也支持视频的加密播放、清晰度切换、直播时移等业务场景",
|
||||||
"main":"lib/vue-aliplayer-v2.umd.min.js",
|
"main": "lib/vue-aliplayer-v2.umd.min.js",
|
||||||
"private": false,
|
"private": false,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -5,6 +5,11 @@
|
|||||||
export default {
|
export default {
|
||||||
name: 'VueAliplayerV2',
|
name: 'VueAliplayerV2',
|
||||||
props: {
|
props: {
|
||||||
|
forbidFastForward: { //禁止拖拽快进
|
||||||
|
required: false,
|
||||||
|
type: [Boolean],
|
||||||
|
default: false
|
||||||
|
},
|
||||||
options: { //配置项
|
options: { //配置项
|
||||||
required: false,
|
required: false,
|
||||||
type: [Object],
|
type: [Object],
|
||||||
@ -15,22 +20,22 @@ export default {
|
|||||||
type: [String],
|
type: [String],
|
||||||
default: null
|
default: null
|
||||||
},
|
},
|
||||||
cssLink:{ //css版本源
|
cssLink: { //css版本源
|
||||||
required: false,
|
required: false,
|
||||||
type: [String],
|
type: [String],
|
||||||
default: `https://g.alicdn.com/de/prismplayer/2.9.0/skins/default/aliplayer-min.css`
|
default: `https://g.alicdn.com/de/prismplayer/2.9.20/skins/default/aliplayer-min.css`
|
||||||
},
|
},
|
||||||
scriptSrc:{ //js版本源
|
scriptSrc: { //js版本源
|
||||||
required: false,
|
required: false,
|
||||||
type: [String],
|
type: [String],
|
||||||
default: `https://g.alicdn.com/de/prismplayer/2.9.0/aliplayer-min.js`
|
default: `https://g.alicdn.com/de/prismplayer/2.9.20/aliplayer-min.js`
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
player: null, //播放器实例
|
player: null, //播放器实例
|
||||||
playerId: `player-${Math.random().toString(36).substr(2).toLocaleUpperCase()}`,
|
playerId: `player-${Math.random().toString(36).substr(2).toLocaleUpperCase()}`,
|
||||||
config:{
|
config: {
|
||||||
id: null, //播放器的ID
|
id: null, //播放器的ID
|
||||||
width: '100%',
|
width: '100%',
|
||||||
autoplay: true,
|
autoplay: true,
|
||||||
@ -38,7 +43,7 @@ export default {
|
|||||||
//支持播放地址播放,此播放优先级最高
|
//支持播放地址播放,此播放优先级最高
|
||||||
// source: 'rtmp://182.145.195.238:1935/hls/1194076936807170050',
|
// source: 'rtmp://182.145.195.238:1935/hls/1194076936807170050',
|
||||||
},
|
},
|
||||||
events:[
|
events: [
|
||||||
/**
|
/**
|
||||||
* 播放器视频初始化按钮渲染完毕。
|
* 播放器视频初始化按钮渲染完毕。
|
||||||
* 播放器UI初始设置需要此事件后触发,避免UI被初始化所覆盖。
|
* 播放器UI初始设置需要此事件后触发,避免UI被初始化所覆盖。
|
||||||
@ -120,56 +125,64 @@ export default {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch:{
|
watch: {
|
||||||
source(){ //监听播放源变化
|
source () { //监听播放源变化
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
|
forbidFastForward () {
|
||||||
|
this.init();
|
||||||
|
|
||||||
options:{ //配置项是对象,只能深度监听
|
},
|
||||||
handler(){
|
|
||||||
this.init();
|
options: { //配置项是对象,只能深度监听
|
||||||
|
handler () {
|
||||||
|
this.init();
|
||||||
},
|
},
|
||||||
deep:true
|
deep: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(() => {
|
||||||
this.init();
|
this.init();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
updated(){
|
updated () {
|
||||||
//重载播放器
|
//重载播放器
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(() => {
|
||||||
this.init();
|
this.init();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handlerFastForward () {
|
||||||
|
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 创建script和css
|
* 创建script和css
|
||||||
* 加载Alipayer的SDK
|
* 加载Alipayer的SDK
|
||||||
*/
|
*/
|
||||||
init(){
|
init () {
|
||||||
const linkID = 'aliplayer-min-css';
|
const linkID = 'app__aliplayer-min-css';
|
||||||
const scriptID = 'aliplayer-min-js';
|
const scriptID = 'app__aliplayer-min-js';
|
||||||
const head = document.getElementsByTagName('head');
|
const head = document.getElementsByTagName('head');
|
||||||
const html = document.getElementsByTagName('html');
|
const html = document.getElementsByTagName('html');
|
||||||
let scriptTag = document.getElementById(scriptID);
|
let scriptTag = document.getElementById(scriptID);
|
||||||
let linkIDTag = document.getElementById(linkID);
|
let linkIDTag = document.getElementById(linkID);
|
||||||
if(!linkIDTag) {
|
if (!linkIDTag) {
|
||||||
// console.log('linkIDTag');
|
// console.log('linkIDTag');
|
||||||
const link = document.createElement('link');
|
const link = document.createElement('link');
|
||||||
link.type = 'text/css';
|
link.type = 'text/css';
|
||||||
link.rel = 'stylesheet';
|
link.rel = 'stylesheet';
|
||||||
link.href = this.cssLink;
|
link.href = this.cssLink;
|
||||||
link.id = linkID;
|
link.id = linkID;
|
||||||
|
// link.className = linkID;
|
||||||
head[0].appendChild(link);
|
head[0].appendChild(link);
|
||||||
}
|
}
|
||||||
if(!scriptTag) {
|
if (!scriptTag) {
|
||||||
// console.log('scriptTag');
|
// console.log('scriptTag');
|
||||||
scriptTag = document.createElement('script');
|
scriptTag = document.createElement('script');
|
||||||
scriptTag.type = "text/javascript";
|
scriptTag.type = "text/javascript";
|
||||||
scriptTag.id = scriptID;
|
scriptTag.id = scriptID;
|
||||||
|
// scriptTag.className = scriptID;
|
||||||
scriptTag.src = this.scriptSrc;
|
scriptTag.src = this.scriptSrc;
|
||||||
html[0].appendChild(scriptTag);
|
html[0].appendChild(scriptTag);
|
||||||
} else {
|
} else {
|
||||||
@ -185,24 +198,42 @@ export default {
|
|||||||
* 创建播放器
|
* 创建播放器
|
||||||
* @description SDK文档地址:https://help.aliyun.com/document_detail/125572.html?spm=a2c4g.11186623.6.1084.131d1c4cJT7o5Z
|
* @description SDK文档地址:https://help.aliyun.com/document_detail/125572.html?spm=a2c4g.11186623.6.1084.131d1c4cJT7o5Z
|
||||||
*/
|
*/
|
||||||
initPlayer(){
|
initPlayer () {
|
||||||
if(typeof window.Aliplayer != 'undefined') {
|
if (typeof window.Aliplayer != 'undefined') {
|
||||||
const options = this.options;
|
const options = this.deepCloneObject(this.options);
|
||||||
if(options){
|
if (options) {
|
||||||
for (const key in options) {
|
for (const key in options) {
|
||||||
this.config[key] = options[key];
|
this.config[key] = options[key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(this.source) this.config.source = this.source; //播放源
|
if (this.source) this.config.source = this.source; //播放源
|
||||||
this.config.id = this.playerId; //赋值播放器容器id
|
this.config.id = this.playerId; //赋值播放器容器id
|
||||||
this.player && this.player.dispose(); //防止实例的重复
|
this.player && this.player.dispose(); //防止实例的重复
|
||||||
this.player = Aliplayer(this.config);
|
this.player = Aliplayer(this.config);
|
||||||
for(const ev in this.events){
|
for (const ev in this.events) {
|
||||||
this.player && this.player.on(this.events[ev],(e)=>{
|
this.player && this.player.on(this.events[ev], (e) => {
|
||||||
// console.log(`object ${this.events[ev]}`,e);
|
// console.log(`object ${this.events[ev]}`,e);
|
||||||
this.$emit(this.events[ev],e);
|
this.$emit(this.events[ev], e);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//开启禁止拖拽快进
|
||||||
|
if (this.forbidFastForward) {
|
||||||
|
let last = 0, max_time = 0;
|
||||||
|
this.player.on('timeupdate', function () {
|
||||||
|
let current = this.getCurrentTime();
|
||||||
|
if (current - last > 2) {
|
||||||
|
this.seek(last);
|
||||||
|
} else {
|
||||||
|
last = current;
|
||||||
|
if (last >= max_time) {
|
||||||
|
max_time = last;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//通过播放器实例的off方法取消订阅
|
//通过播放器实例的off方法取消订阅
|
||||||
//player.off('ready',handleReady);
|
//player.off('ready',handleReady);
|
||||||
}
|
}
|
||||||
@ -211,14 +242,14 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* @return player 实例
|
* @return player 实例
|
||||||
*/
|
*/
|
||||||
getPlayer(){
|
getPlayer () {
|
||||||
return this.player;
|
return this.player;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 播放视频。
|
* 播放视频。
|
||||||
*/
|
*/
|
||||||
play(){
|
play () {
|
||||||
// console.log(`播放视频。`);
|
// console.log(`播放视频。`);
|
||||||
this.player && this.player.play();
|
this.player && this.player.play();
|
||||||
},
|
},
|
||||||
@ -226,7 +257,7 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 暂停视频
|
* 暂停视频
|
||||||
*/
|
*/
|
||||||
pause(){
|
pause () {
|
||||||
// console.log(`暂停视频`);
|
// console.log(`暂停视频`);
|
||||||
this.player && this.player.pause();
|
this.player && this.player.pause();
|
||||||
},
|
},
|
||||||
@ -234,7 +265,7 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 重播视频
|
* 重播视频
|
||||||
*/
|
*/
|
||||||
replay(){
|
replay () {
|
||||||
// console.log(`重播视频`);
|
// console.log(`重播视频`);
|
||||||
this.player && this.player.replay();
|
this.player && this.player.replay();
|
||||||
},
|
},
|
||||||
@ -244,7 +275,7 @@ export default {
|
|||||||
* @param time
|
* @param time
|
||||||
* @return player
|
* @return player
|
||||||
*/
|
*/
|
||||||
seek(time){
|
seek (time) {
|
||||||
// console.log(`跳转到某个时刻进行播放,time为${time}秒。`);
|
// console.log(`跳转到某个时刻进行播放,time为${time}秒。`);
|
||||||
this.player && this.player.seek(time);
|
this.player && this.player.seek(time);
|
||||||
},
|
},
|
||||||
@ -253,7 +284,7 @@ export default {
|
|||||||
* 获取当前的播放时刻,返回的单位为秒。
|
* 获取当前的播放时刻,返回的单位为秒。
|
||||||
* @return player
|
* @return player
|
||||||
*/
|
*/
|
||||||
getCurrentTime(){
|
getCurrentTime () {
|
||||||
// console.log(`获取当前的播放时刻,返回的单位为${this.player && this.player.getCurrentTime()}秒。`);
|
// console.log(`获取当前的播放时刻,返回的单位为${this.player && this.player.getCurrentTime()}秒。`);
|
||||||
return this.player && this.player.getCurrentTime();
|
return this.player && this.player.getCurrentTime();
|
||||||
},
|
},
|
||||||
@ -262,7 +293,7 @@ export default {
|
|||||||
* 获取视频总时长,返回的单位为秒,这个需要在视频加载完成以后才可以获取到,可以在play事件后获取。
|
* 获取视频总时长,返回的单位为秒,这个需要在视频加载完成以后才可以获取到,可以在play事件后获取。
|
||||||
* @return player
|
* @return player
|
||||||
*/
|
*/
|
||||||
getDuration(){
|
getDuration () {
|
||||||
// console.log(`获取视频总时长,返回的单位为${this.player && this.player.getDuration()}秒。`);
|
// console.log(`获取视频总时长,返回的单位为${this.player && this.player.getDuration()}秒。`);
|
||||||
return this.player && this.player.getDuration();
|
return this.player && this.player.getDuration();
|
||||||
},
|
},
|
||||||
@ -271,7 +302,7 @@ export default {
|
|||||||
* 获取当前的音量,返回值为0-1的实数。ios和部分android会失效。
|
* 获取当前的音量,返回值为0-1的实数。ios和部分android会失效。
|
||||||
* @return player
|
* @return player
|
||||||
*/
|
*/
|
||||||
getVolume(){
|
getVolume () {
|
||||||
// console.log(`获取当前的音量${this.player && this.player.getVolume()}。`);
|
// console.log(`获取当前的音量${this.player && this.player.getVolume()}。`);
|
||||||
return this.player && this.player.getVolume();
|
return this.player && this.player.getVolume();
|
||||||
},
|
},
|
||||||
@ -280,7 +311,7 @@ export default {
|
|||||||
* 设置音量,vol为0-1的实数,ios和部分android会失效。
|
* 设置音量,vol为0-1的实数,ios和部分android会失效。
|
||||||
* @return player
|
* @return player
|
||||||
*/
|
*/
|
||||||
setVolume(v){
|
setVolume (v) {
|
||||||
// console.log(`设置音量,vol为${v}。`);
|
// console.log(`设置音量,vol为${v}。`);
|
||||||
this.player && this.player.setVolume(v);
|
this.player && this.player.setVolume(v);
|
||||||
},
|
},
|
||||||
@ -290,7 +321,7 @@ export default {
|
|||||||
* 暂不支持直播rtmp流切换。
|
* 暂不支持直播rtmp流切换。
|
||||||
* @return player
|
* @return player
|
||||||
*/
|
*/
|
||||||
loadByUrl(url, time){
|
loadByUrl (url, time) {
|
||||||
// console.log(`直接播放视频url${url},time为${time}。`);
|
// console.log(`直接播放视频url${url},time为${time}。`);
|
||||||
this.player && this.player.loadByUrl(url, time);
|
this.player && this.player.loadByUrl(url, time);
|
||||||
},
|
},
|
||||||
@ -300,7 +331,7 @@ export default {
|
|||||||
* @param vid 视频id
|
* @param vid 视频id
|
||||||
* @param 播放凭证
|
* @param 播放凭证
|
||||||
*/
|
*/
|
||||||
replayByVidAndPlayAuth(vid, playauth){
|
replayByVidAndPlayAuth (vid, playauth) {
|
||||||
// console.log(`replayByVidAndPlayAuth vid${vid},playauth为${playauth}。`);
|
// console.log(`replayByVidAndPlayAuth vid${vid},playauth为${playauth}。`);
|
||||||
this.player && this.player.replayByVidAndPlayAuth(vid, playauth);
|
this.player && this.player.replayByVidAndPlayAuth(vid, playauth);
|
||||||
},
|
},
|
||||||
@ -311,7 +342,7 @@ export default {
|
|||||||
* @param 播放凭证
|
* @param 播放凭证
|
||||||
* @description 仅MPS用户时使用 仅MPS用户时使用 参数顺序为:vid、accId、accSecret、stsToken、authInfo、domainRegion
|
* @description 仅MPS用户时使用 仅MPS用户时使用 参数顺序为:vid、accId、accSecret、stsToken、authInfo、domainRegion
|
||||||
*/
|
*/
|
||||||
replayByVidAndAuthInfo(vid, accId, accSecret, stsToken, authInfo, domainRegion){
|
replayByVidAndAuthInfo (vid, accId, accSecret, stsToken, authInfo, domainRegion) {
|
||||||
// console.log(`replayByVidAndAuthInfo 参数顺序为:vid、accId、accSecret、stsToken、authInfo、domainRegion`,vid, accId, accSecret, stsToken, authInfo, domainRegion);
|
// console.log(`replayByVidAndAuthInfo 参数顺序为:vid、accId、accSecret、stsToken、authInfo、domainRegion`,vid, accId, accSecret, stsToken, authInfo, domainRegion);
|
||||||
this.player && this.player.replayByVidAndAuthInfo(vid, accId, accSecret, stsToken, authInfo, domainRegion);
|
this.player && this.player.replayByVidAndAuthInfo(vid, accId, accSecret, stsToken, authInfo, domainRegion);
|
||||||
},
|
},
|
||||||
@ -322,7 +353,7 @@ export default {
|
|||||||
* @param h 宽度
|
* @param h 宽度
|
||||||
* @description chrome浏览器下flash播放器分别不能小于397x297。
|
* @description chrome浏览器下flash播放器分别不能小于397x297。
|
||||||
*/
|
*/
|
||||||
setPlayerSize(w, h){
|
setPlayerSize (w, h) {
|
||||||
// console.log(`设置播放器大小 宽度:${w},高度:${h}`);
|
// console.log(`设置播放器大小 宽度:${w},高度:${h}`);
|
||||||
this.player && this.player.setPlayerSize(w, h);
|
this.player && this.player.setPlayerSize(w, h);
|
||||||
},
|
},
|
||||||
@ -334,7 +365,7 @@ export default {
|
|||||||
* @param h 宽度
|
* @param h 宽度
|
||||||
* @description {name:“speedButton”,align:“tr”,x:10,y:23}
|
* @description {name:“speedButton”,align:“tr”,x:10,y:23}
|
||||||
*/
|
*/
|
||||||
setSpeed(speed){
|
setSpeed (speed) {
|
||||||
// console.log(`手动设置播放的倍速:${speed}`);
|
// console.log(`手动设置播放的倍速:${speed}`);
|
||||||
this.player && this.player.setSpeed(speed);
|
this.player && this.player.setSpeed(speed);
|
||||||
},
|
},
|
||||||
@ -345,7 +376,7 @@ export default {
|
|||||||
* @param height 高度
|
* @param height 高度
|
||||||
* @param rate 截图质量
|
* @param rate 截图质量
|
||||||
*/
|
*/
|
||||||
setSanpshotProperties(width, height, rate){
|
setSanpshotProperties (width, height, rate) {
|
||||||
// console.log(`设置截图参数:`,width, height, rate);
|
// console.log(`设置截图参数:`,width, height, rate);
|
||||||
this.player && this.player.setSanpshotProperties(width, height, rate);
|
this.player && this.player.setSanpshotProperties(width, height, rate);
|
||||||
},
|
},
|
||||||
@ -353,7 +384,7 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 播放器全屏,仅H5支持。
|
* 播放器全屏,仅H5支持。
|
||||||
*/
|
*/
|
||||||
requestFullScreen(){
|
requestFullScreen () {
|
||||||
// console.log(`播放器全屏,仅H5支持`);
|
// console.log(`播放器全屏,仅H5支持`);
|
||||||
this.player && this.player.fullscreenService && this.player.fullscreenService.requestFullScreen();
|
this.player && this.player.fullscreenService && this.player.fullscreenService.requestFullScreen();
|
||||||
},
|
},
|
||||||
@ -361,7 +392,7 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 播放器退出全屏,iOS调用无效,仅H5支持。
|
* 播放器退出全屏,iOS调用无效,仅H5支持。
|
||||||
*/
|
*/
|
||||||
cancelFullScreen(){
|
cancelFullScreen () {
|
||||||
// console.log(`播放器全屏,仅H5支持`);
|
// console.log(`播放器全屏,仅H5支持`);
|
||||||
this.player && this.player.fullscreenService && this.player.fullscreenService.cancelFullScreen();
|
this.player && this.player.fullscreenService && this.player.fullscreenService.cancelFullScreen();
|
||||||
},
|
},
|
||||||
@ -369,7 +400,7 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 获取播放器全屏状态,仅H5支持。
|
* 获取播放器全屏状态,仅H5支持。
|
||||||
*/
|
*/
|
||||||
getIsFullScreen(){
|
getIsFullScreen () {
|
||||||
// console.log(`获取播放器全屏状态,仅H5支持。`,this.player && this.player.fullscreenService && this.player && this.player.fullscreenService.getIsFullScreen());
|
// console.log(`获取播放器全屏状态,仅H5支持。`,this.player && this.player.fullscreenService && this.player && this.player.fullscreenService.getIsFullScreen());
|
||||||
return this.player && this.player.fullscreenService && this.player.fullscreenService.getIsFullScreen();
|
return this.player && this.player.fullscreenService && this.player.fullscreenService.getIsFullScreen();
|
||||||
},
|
},
|
||||||
@ -378,7 +409,7 @@ export default {
|
|||||||
* 获取播放器状态,包含的值,
|
* 获取播放器状态,包含的值,
|
||||||
* @returns init ready loading play pause playing waiting error ended
|
* @returns init ready loading play pause playing waiting error ended
|
||||||
*/
|
*/
|
||||||
getStatus(){
|
getStatus () {
|
||||||
// console.log(`获取播放器状态,包含的值`,this.player && this.player.fullscreenService && this.player && this.player.fullscreenService.getStatus());
|
// console.log(`获取播放器状态,包含的值`,this.player && this.player.fullscreenService && this.player && this.player.fullscreenService.getStatus());
|
||||||
return this.player && this.player.getStatus();
|
return this.player && this.player.getStatus();
|
||||||
},
|
},
|
||||||
@ -389,7 +420,7 @@ export default {
|
|||||||
* @param endTime 结束时间
|
* @param endTime 结束时间
|
||||||
* @description 例子:player.liveShiftSerivce.setLiveTimeRange(“”,‘2018/01/04 20:00:00’)
|
* @description 例子:player.liveShiftSerivce.setLiveTimeRange(“”,‘2018/01/04 20:00:00’)
|
||||||
*/
|
*/
|
||||||
setLiveTimeRange(beginTime, endTime){
|
setLiveTimeRange (beginTime, endTime) {
|
||||||
// console.log(`设置直播的开始时间:${beginTime},结束时间:${endTime},开启直播时移功能时使用。`);
|
// console.log(`设置直播的开始时间:${beginTime},结束时间:${endTime},开启直播时移功能时使用。`);
|
||||||
this.player && this.player.liveShiftSerivce && this.player.liveShiftSerivce.setLiveTimeRange(beginTime, endTime);
|
this.player && this.player.liveShiftSerivce && this.player.liveShiftSerivce.setLiveTimeRange(beginTime, endTime);
|
||||||
},
|
},
|
||||||
@ -399,7 +430,7 @@ export default {
|
|||||||
* @param rotate 旋转角度
|
* @param rotate 旋转角度
|
||||||
* @description 例如: setRotate(90)。详情参见旋转和镜像。
|
* @description 例如: setRotate(90)。详情参见旋转和镜像。
|
||||||
*/
|
*/
|
||||||
setRotate(rotate){
|
setRotate (rotate) {
|
||||||
// console.log(`参数为旋转角度:${rotate}。`);
|
// console.log(`参数为旋转角度:${rotate}。`);
|
||||||
this.player && this.player.setRotate(rotate);
|
this.player && this.player.setRotate(rotate);
|
||||||
},
|
},
|
||||||
@ -408,7 +439,7 @@ export default {
|
|||||||
* 获取旋转角度。详情参见旋转和镜像。
|
* 获取旋转角度。详情参见旋转和镜像。
|
||||||
* @return rotate 旋转角度
|
* @return rotate 旋转角度
|
||||||
*/
|
*/
|
||||||
getRotate(){
|
getRotate () {
|
||||||
// console.log(`获取旋转角度:${this.player && this.player.getRotate()}`);
|
// console.log(`获取旋转角度:${this.player && this.player.getRotate()}`);
|
||||||
return this.player && this.player.getRotate();
|
return this.player && this.player.getRotate();
|
||||||
},
|
},
|
||||||
@ -418,7 +449,7 @@ export default {
|
|||||||
* @param image 镜像类型 可选值为:horizon,vertical
|
* @param image 镜像类型 可选值为:horizon,vertical
|
||||||
* @description 例如: setImage(‘horizon’)。详情参见旋转和镜像。
|
* @description 例如: setImage(‘horizon’)。详情参见旋转和镜像。
|
||||||
*/
|
*/
|
||||||
setImage(image){
|
setImage (image) {
|
||||||
// console.log(`设置镜像:${image}。`);
|
// console.log(`设置镜像:${image}。`);
|
||||||
this.player && this.player.setImage(image);
|
this.player && this.player.setImage(image);
|
||||||
},
|
},
|
||||||
@ -426,7 +457,7 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 播放器销毁
|
* 播放器销毁
|
||||||
*/
|
*/
|
||||||
dispose(){
|
dispose () {
|
||||||
// console.log(`播放器销毁。`);
|
// console.log(`播放器销毁。`);
|
||||||
this.player && this.player.dispose();
|
this.player && this.player.dispose();
|
||||||
},
|
},
|
||||||
@ -435,7 +466,7 @@ export default {
|
|||||||
* 设置封面
|
* 设置封面
|
||||||
* @param cover 封面地址
|
* @param cover 封面地址
|
||||||
*/
|
*/
|
||||||
setCover(cover){
|
setCover (cover) {
|
||||||
// console.log(`设置封面:${cover}`);
|
// console.log(`设置封面:${cover}`);
|
||||||
this.player && this.player.setCover(cover);
|
this.player && this.player.setCover(cover);
|
||||||
},
|
},
|
||||||
@ -444,7 +475,7 @@ export default {
|
|||||||
* 设置封面
|
* 设置封面
|
||||||
* @param markers 设置打点数据
|
* @param markers 设置打点数据
|
||||||
*/
|
*/
|
||||||
setProgressMarkers(markers){
|
setProgressMarkers (markers) {
|
||||||
// console.log(`markers打点数据集合:${markers}`);
|
// console.log(`markers打点数据集合:${markers}`);
|
||||||
this.player && this.player.setProgressMarkers(markers);
|
this.player && this.player.setProgressMarkers(markers);
|
||||||
},
|
},
|
||||||
@ -453,7 +484,7 @@ export default {
|
|||||||
* 设置试看时间,单位为秒,详情参见
|
* 设置试看时间,单位为秒,详情参见
|
||||||
* @param time 试看时间
|
* @param time 试看时间
|
||||||
*/
|
*/
|
||||||
setPreviewTime(time){
|
setPreviewTime (time) {
|
||||||
// console.log(`设置试看时间,单位为:${time}秒`);
|
// console.log(`设置试看时间,单位为:${time}秒`);
|
||||||
this.player && this.player.setPreviewTime(time);
|
this.player && this.player.setPreviewTime(time);
|
||||||
},
|
},
|
||||||
@ -462,7 +493,7 @@ export default {
|
|||||||
* 获取试看时间
|
* 获取试看时间
|
||||||
* @return rotate 旋转角度
|
* @return rotate 旋转角度
|
||||||
*/
|
*/
|
||||||
getPreviewTime(){
|
getPreviewTime () {
|
||||||
// console.log(`获取试看时间:${this.player && this.player.getPreviewTime()}`);
|
// console.log(`获取试看时间:${this.player && this.player.getPreviewTime()}`);
|
||||||
return this.player && this.player.getPreviewTime();
|
return this.player && this.player.getPreviewTime();
|
||||||
},
|
},
|
||||||
@ -470,7 +501,7 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* 是否试看
|
* 是否试看
|
||||||
*/
|
*/
|
||||||
isPreview(){
|
isPreview () {
|
||||||
// console.log(`是否试看`);
|
// console.log(`是否试看`);
|
||||||
this.player && this.player.isPreview();
|
this.player && this.player.isPreview();
|
||||||
},
|
},
|
||||||
@ -479,17 +510,46 @@ export default {
|
|||||||
* @param ev 事件名
|
* @param ev 事件名
|
||||||
* @param handle 回调方法
|
* @param handle 回调方法
|
||||||
*/
|
*/
|
||||||
off(ev,handle){
|
off (ev, handle) {
|
||||||
this.player && this.player.off(ev,handle);
|
this.player && this.player.off(ev, handle);
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 深度拷贝
|
||||||
|
* @param {*} obj
|
||||||
|
*/
|
||||||
|
deepCloneObject (obj) {
|
||||||
|
let objClone = Array.isArray(obj) ? [] : {};
|
||||||
|
if (obj && typeof obj === 'object') {
|
||||||
|
for (let key in obj) {
|
||||||
|
if (obj.hasOwnProperty(key)) {
|
||||||
|
//判断ojb子元素是否为对象,如果是,递归复制
|
||||||
|
if (obj[key] && typeof obj[key] === 'object') {
|
||||||
|
objClone[key] = this.deepCloneObject(obj[key]);
|
||||||
|
} else {
|
||||||
|
//如果不是,简单复制
|
||||||
|
objClone[key] = obj[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return objClone;
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
beforeDestroy(){ //防止重复创建
|
beforeDestroy () { //防止重复创建
|
||||||
this.dispose(); //销毁播放器(防止直播播放的情况下,播放器已经销毁,而后台还在继续下载资源造成卡顿的bug)
|
this.dispose(); //销毁播放器(防止直播播放的情况下,播放器已经销毁,而后台还在继续下载资源造成卡顿的bug)
|
||||||
const head = document.querySelector('head'); //移除所有的重复创建的标签
|
// const head = document.querySelector('head');
|
||||||
const nodes = document.querySelectorAll('script[src="https://g.alicdn.com/de/prismplayer/2.8.2/hls/aliplayer-hls-min.js"]');
|
// const cssNodes = document.querySelectorAll(`link.app__aliplayer-min-css`);
|
||||||
head && nodes.forEach((item)=>{
|
// (html && cssNodes.length > 1) && cssNodes.forEach((item, index)=>{
|
||||||
head.removeChild(item);
|
// if(index != 0) head.removeChild(item);
|
||||||
});
|
// });
|
||||||
|
// const html = document.querySelector('html');
|
||||||
|
// const jsNodes = document.querySelectorAll(`script.app__aliplayer-min-js`);
|
||||||
|
// (html && jsNodes.length > 1) && jsNodes.forEach((item, index)=>{
|
||||||
|
// if(index != 0) html.removeChild(item);
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
25
pages.sh
Normal file
25
pages.sh
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
echo "打包 => dist";
|
||||||
|
|
||||||
|
# 打包 => dist
|
||||||
|
npm run build;
|
||||||
|
|
||||||
|
# 更新gh-pages
|
||||||
|
echo "更新gh-pages";
|
||||||
|
|
||||||
|
git branch -D gh-pages;
|
||||||
|
|
||||||
|
echo "删除gh-pages";
|
||||||
|
|
||||||
|
git checkout -b gh-pages;
|
||||||
|
|
||||||
|
echo "创建并切换到gh-pages";
|
||||||
|
|
||||||
|
git add -f dist;
|
||||||
|
|
||||||
|
git commit -m 'create gh-pages';
|
||||||
|
|
||||||
|
git push origin -d gh-pages;
|
||||||
|
|
||||||
|
git subtree push --prefix dist origin gh-pages;
|
||||||
|
|
||||||
|
echo "已推送gh-pages";
|
Loading…
x
Reference in New Issue
Block a user