MSE in switchVideo
This commit is contained in:
parent
a3883ec046
commit
38c10cbd5a
|
|
@ -75,11 +75,10 @@
|
|||
]
|
||||
});
|
||||
function switchDPlayer() {
|
||||
if (dp2.option.danmaku.id !== '5rGf5Y2X55qu6Z2p') {
|
||||
if (dp2.danmaku.options.api.id !== '5rGf5Y2X55qu6Z2p') {
|
||||
dp2.switchVideo({
|
||||
url: 'http://devtest.qiniudn.com/微小微-江南皮革厂倒闭了.mp4',
|
||||
pic: 'http://devtest.qiniudn.com/微小微-江南皮革厂倒闭了.jpg',
|
||||
type: 'auto',
|
||||
url: 'http://devtest.qiniudn.com/若能绽放光芒5.m3u8',
|
||||
type: 'hls'
|
||||
},
|
||||
{
|
||||
id: '5rGf5Y2X55qu6Z2p',
|
||||
|
|
@ -95,7 +94,7 @@
|
|||
type: 'auto',
|
||||
},
|
||||
{
|
||||
id: '9E2E3368B56CDBB42',
|
||||
id: '9E2E3368B56CDBB4',
|
||||
api: 'https://api.prprpr.me/dplayer/',
|
||||
maximum: 3000,
|
||||
user: 'DIYgod'
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "dplayer",
|
||||
"version": "1.8.0",
|
||||
"version": "1.8.1",
|
||||
"description": "Wow, such a lovely HTML5 danmaku video player",
|
||||
"main": "dist/DPlayer.min.js",
|
||||
"style": "dist/DPlayer.min.css",
|
||||
|
|
|
|||
|
|
@ -920,9 +920,10 @@ class DPlayer {
|
|||
* @param {Object} danmaku - new danmaku info
|
||||
*/
|
||||
switchVideo (video, danmakuAPI) {
|
||||
this.pause();
|
||||
this.video.poster = video.pic ? video.pic : '';
|
||||
this.video.src = video.url;
|
||||
this.pause();
|
||||
this.initMSE(this.video, video.type || 'auto');
|
||||
if (danmakuAPI) {
|
||||
this.element.getElementsByClassName('dplayer-danloading')[0].style.display = 'block';
|
||||
this.updateBar('played', 0, 'width');
|
||||
|
|
@ -942,7 +943,7 @@ class DPlayer {
|
|||
}
|
||||
}
|
||||
|
||||
initVideo (video, type) {
|
||||
initMSE (video, type) {
|
||||
this.type = type;
|
||||
if (this.type === 'auto') {
|
||||
if (/m3u8(#|\?|$)/i.exec(video.src)) {
|
||||
|
|
@ -973,6 +974,10 @@ class DPlayer {
|
|||
flvPlayer.attachMediaElement(video);
|
||||
flvPlayer.load();
|
||||
}
|
||||
}
|
||||
|
||||
initVideo (video, type) {
|
||||
this.initMSE(video, type);
|
||||
|
||||
/**
|
||||
* video events
|
||||
|
|
|
|||
Loading…
Reference in New Issue