mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-16 01:26:16 -08:00
separate variable constants
This commit is contained in:
1 parent
57a14f63ac
commit
fc3abd7d1d
20 files changed
+143
-80
No files matched your search
@@ -3,6 +3,7 @@ import { setStyle, addClass, removeClass, hasClass } from '../utils';
|
||||
export default function autoOrientation(art) {
|
||||
const {
|
||||
option,
|
||||
constructor,
|
||||
template: { $player, $video },
|
||||
} = art;
|
||||
|
||||
@@ -21,7 +22,7 @@ export default function autoOrientation(art) {
|
||||
setStyle($player, 'transform-origin', '0 0');
|
||||
setStyle($player, 'transform', `rotate(90deg) translate(0, -${viewWidth}px)`);
|
||||
addClass($player, 'art-auto-orientation');
|
||||
}, 100);
|
||||
}, constructor.MOBILE_AUTO_ORIENTATION_TIME);
|
||||
}
|
||||
} else {
|
||||
if (hasClass($player, 'art-auto-orientation')) {
|
||||
|
||||
@@ -4,13 +4,14 @@ export default function autoPlayback(art) {
|
||||
const {
|
||||
i18n,
|
||||
storage,
|
||||
constructor,
|
||||
template: { $poster },
|
||||
} = art;
|
||||
|
||||
art.on('video:timeupdate', () => {
|
||||
const times = storage.get('times') || {};
|
||||
const keys = Object.keys(times);
|
||||
if (keys.length > 10) delete times[keys[0]];
|
||||
if (keys.length > constructor.AUTO_PLAYBACK_MAX) delete times[keys[0]];
|
||||
times[art.option.url] = art.currentTime;
|
||||
storage.set('times', times);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user