mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-29 19:41:25 -08:00
删除多余事件
This commit is contained in:
1 parent
e0faa3fe68
commit
7ff61b4660
38 files changed
+266
-516
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import { getExt, def } from '../utils';
|
||||
|
||||
export default function urlMix(art, player) {
|
||||
const {
|
||||
option: { type, customType },
|
||||
template: { $video },
|
||||
} = art;
|
||||
|
||||
def(player, 'url', {
|
||||
get() {
|
||||
return $video.src;
|
||||
},
|
||||
set(url) {
|
||||
const typeName = type || getExt(url);
|
||||
const typeCallback = customType[typeName];
|
||||
if (typeName && typeCallback) {
|
||||
art.loading.show = true;
|
||||
typeCallback.call(art, $video, url, art);
|
||||
art.emit('customType', typeName);
|
||||
} else {
|
||||
$video.src = url;
|
||||
art.option.url = url;
|
||||
art.emit('urlChange', url);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user