mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 23:51:20 -08:00
remove player object
This commit is contained in:
1 parent
59a8ccce81
commit
59400eb3bf
58 files changed
+295
-313
No files matched your search
@@ -1,14 +1,13 @@
|
||||
import { append, tooltip, setStyle } from '../utils';
|
||||
|
||||
export default function playAndPause(option) {
|
||||
return art => ({
|
||||
return (art) => ({
|
||||
...option,
|
||||
mounted: $control => {
|
||||
mounted: ($control) => {
|
||||
const {
|
||||
events: { proxy },
|
||||
icons,
|
||||
i18n,
|
||||
player,
|
||||
} = art;
|
||||
|
||||
const $play = append($control, icons.play);
|
||||
@@ -17,11 +16,11 @@ export default function playAndPause(option) {
|
||||
tooltip($pause, i18n.get('Pause'));
|
||||
|
||||
proxy($play, 'click', () => {
|
||||
player.play();
|
||||
art.play();
|
||||
});
|
||||
|
||||
proxy($pause, 'click', () => {
|
||||
player.pause();
|
||||
art.pause();
|
||||
});
|
||||
|
||||
function showPlay() {
|
||||
@@ -34,7 +33,7 @@ export default function playAndPause(option) {
|
||||
setStyle($pause, 'display', 'flex');
|
||||
}
|
||||
|
||||
if (player.playing) {
|
||||
if (art.playing) {
|
||||
showPause();
|
||||
} else {
|
||||
showPlay();
|
||||
|
||||
Reference in new issue
Block a user