添加flv.js演示

This commit is contained in:
Harvey Zack committed 2018-11-24 17:08:36 +08:00
1 parent c7c9e0a311
commit 8a9f70720a
11 files changed
+143 -33

No files matched your search

@@ -0,0 +1,26 @@
export default function attachUrlMix(art, player) {
const {
option: { type, customType },
refs: { $video },
} = art;
Object.defineProperty(player, 'returnUrl', {
writable: true,
value: url => url,
});
Object.defineProperty(player, 'attachUrl', {
value: url => {
const typeCallback = customType[type];
if (type && typeCallback) {
art.emit('beforeCustomType', url);
typeCallback($video, player.returnUrl(url), art);
art.emit('afterCustomType', url);
} else {
art.emit('beforeAttachUrl', url);
$video.src = player.returnUrl(url);
art.emit('afterAttachUrl', url);
}
},
});
}