mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 01:21:20 -08:00
添加hls.js演示
This commit is contained in:
1 parent
63c178e177
commit
7c3f7f2696
14 files changed
+194
-119
No files matched your search
@@ -1,3 +1,5 @@
|
||||
import { getExt } from '../utils';
|
||||
|
||||
export default function attachUrlMix(art, player) {
|
||||
const {
|
||||
option: { type, customType },
|
||||
@@ -11,11 +13,12 @@ export default function attachUrlMix(art, player) {
|
||||
|
||||
Object.defineProperty(player, 'attachUrl', {
|
||||
value: url => {
|
||||
const typeCallback = customType[type];
|
||||
if (type && typeCallback) {
|
||||
art.emit('beforeCustomType', type);
|
||||
const typeName = type || getExt(url);
|
||||
const typeCallback = customType[typeName];
|
||||
if (typeName && typeCallback) {
|
||||
art.emit('beforeCustomType', typeName);
|
||||
typeCallback($video, player.returnUrl(url), art);
|
||||
art.emit('afterCustomType', type);
|
||||
art.emit('afterCustomType', typeName);
|
||||
} else {
|
||||
art.emit('beforeAttachUrl', url);
|
||||
$video.src = player.returnUrl(url);
|
||||
|
||||
Reference in new issue
Block a user