添加hls.js演示

This commit is contained in:
Harvey Zack committed 2018-11-24 22:26:26 +08:00
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);