fix m3u8 and flv judgment
This commit is contained in:
parent
be18f2e0bd
commit
ea63bdfe7b
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -283,7 +283,7 @@ class DPlayer {
|
|||
this.video = this.element.getElementsByClassName('dplayer-video')[0];
|
||||
|
||||
// Support HTTP Live Streaming
|
||||
if (this.option.video.url.match(/(m3u8)$/i) && Hls.isSupported()) {
|
||||
if (/(m3u8\?|m3u8$)/i.exec(this.option.video.url) && Hls.isSupported()) {
|
||||
this.element.getElementsByClassName('dplayer-time')[0].style.display = 'none';
|
||||
const hls = new Hls();
|
||||
hls.attachMedia(this.video);
|
||||
|
|
@ -296,7 +296,7 @@ class DPlayer {
|
|||
}
|
||||
|
||||
// Support FLV
|
||||
if (this.option.video.url.match(/(flv)$/i) && flvjs.isSupported()) {
|
||||
if (/(flv\?|flv$)/i.exec(this.option.video.url) && flvjs.isSupported()) {
|
||||
const flvPlayer = flvjs.createPlayer({
|
||||
type: 'flv',
|
||||
url: this.option.video.url
|
||||
|
|
|
|||
Loading…
Reference in New Issue