mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 22:01:20 -08:00
添加flv.js演示
This commit is contained in:
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);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user