mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 06:31:20 -08:00
简化player接口
This commit is contained in:
1 parent
1b69b28ba1
commit
52b6693da2
41 files changed
+624
-690
No files matched your search
@@ -7,13 +7,13 @@ export default function switchMix(art, player) {
|
||||
const { currentTime, playing } = player;
|
||||
return player.attachUrl(url).then(() => {
|
||||
option.url = url;
|
||||
player.playbackRateRemove();
|
||||
player.aspectRatioRemove();
|
||||
player.playbackRate = false;
|
||||
player.aspectRatio = false;
|
||||
art.once('video:canplay', () => {
|
||||
player.currentTime = currentTime;
|
||||
});
|
||||
if (playing) {
|
||||
player.play();
|
||||
player.play = true;
|
||||
}
|
||||
notice.show(`${i18n.get('Switch video')}: ${name}`);
|
||||
art.emit('switch', url);
|
||||
@@ -29,11 +29,11 @@ export default function switchMix(art, player) {
|
||||
const { playing } = player;
|
||||
return player.attachUrl(url).then(() => {
|
||||
option.url = url;
|
||||
player.playbackRateRemove();
|
||||
player.aspectRatioRemove();
|
||||
player.playbackRate = false;
|
||||
player.aspectRatio = false;
|
||||
player.currentTime = 0;
|
||||
if (playing) {
|
||||
player.play();
|
||||
player.play = true;
|
||||
}
|
||||
notice.show(`${i18n.get('Switch video')}: ${name}`);
|
||||
art.emit('switch', url);
|
||||
|
||||
Reference in new issue
Block a user