mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-14 00:06:17 -08:00
add DBCLICK_FULLSCREEN
This commit is contained in:
1 parent
4244b085dc
commit
fb445bf669
5 files changed
+32
-13
No files matched your search
@@ -21,21 +21,28 @@ export default function clickInit(art, events) {
|
||||
let clickTime = 0;
|
||||
events.proxy($video, 'click', (event) => {
|
||||
const now = Date.now();
|
||||
const { MOBILE_CLICK_PLAY, DBCLICK_TIME, MOBILE_DBCLICK_PLAY, DBCLICK_FULLSCREEN } = constructor;
|
||||
|
||||
if (now - clickTime <= constructor.DB_CLICE_TIME) {
|
||||
if (now - clickTime <= DBCLICK_TIME) {
|
||||
art.emit('dblclick', event);
|
||||
|
||||
if (isMobile) {
|
||||
if (!art.isLock) {
|
||||
if (!art.isLock && MOBILE_DBCLICK_PLAY) {
|
||||
art.toggle();
|
||||
}
|
||||
} else {
|
||||
art.fullscreen = !art.fullscreen;
|
||||
if (DBCLICK_FULLSCREEN) {
|
||||
art.fullscreen = !art.fullscreen;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
art.emit('click', event);
|
||||
|
||||
if (!isMobile) {
|
||||
if (isMobile) {
|
||||
if (!art.isLock && MOBILE_CLICK_PLAY) {
|
||||
art.toggle();
|
||||
}
|
||||
} else {
|
||||
art.toggle();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,7 +234,10 @@ Artplayer.AUTO_PLAYBACK_TIMEOUT = 3000;
|
||||
Artplayer.RECONNECT_TIME_MAX = 5;
|
||||
Artplayer.RECONNECT_SLEEP_TIME = 1000;
|
||||
Artplayer.CONTROL_HIDE_TIME = 3000;
|
||||
Artplayer.DB_CLICE_TIME = 300;
|
||||
Artplayer.DBCLICK_TIME = 300;
|
||||
Artplayer.DBCLICK_FULLSCREEN = true;
|
||||
Artplayer.MOBILE_DBCLICK_PLAY = true;
|
||||
Artplayer.MOBILE_CLICK_PLAY = false;
|
||||
Artplayer.MOBILE_AUTO_PLAYBACKRATE = 3;
|
||||
Artplayer.MOBILE_AUTO_PLAYBACKRATE_TIME = 1000;
|
||||
Artplayer.MOBILE_AUTO_ORIENTATION_TIME = 200;
|
||||
|
||||
+4
-1
@@ -43,7 +43,10 @@ declare class Artplayer extends Player {
|
||||
static RECONNECT_TIME_MAX: number;
|
||||
static RECONNECT_SLEEP_TIME: number;
|
||||
static CONTROL_HIDE_TIME: number;
|
||||
static DB_CLICE_TIME: number;
|
||||
static DBCLICK_TIME: number;
|
||||
static DBCLICK_FULLSCREEN: boolean;
|
||||
static MOBILE_DBCLICK_PLAY: boolean;
|
||||
static MOBILE_CLICK_PLAY: boolean;
|
||||
static MOBILE_AUTO_PLAYBACKRAT: number;
|
||||
static MOBILE_AUTO_PLAYBACKRATE_TIME: number;
|
||||
static MOBILE_AUTO_ORIENTATION_TIME: number;
|
||||
|
||||
Reference in new issue
Block a user