-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathevents.js
41 lines (40 loc) · 1008 Bytes
/
events.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import device from './device'
const prefix = 'IGGFE_'
const types = [
'SOURCE_CHANGE',
'RELOAD',
'AUTO_RECOVER',
'BEFORE_AUTO_RELOAD',
'AUTO_RELOAD',
'COMMENT',
'LOAD',
'READY',
'BROWSER_AUTO_PLAY_BLOCKED',
'DAN_MU_VISIBLE_CHANGE',
'VIDEO_SIZE_CHANGE',
'EVENT',
'ERROR',
'ERROR_TIP',
'LOG',
'USER_ACTIVE_CHANGE',
'DRAG_END',
'QUALITY_CHANGE',
'FULLSCREEN_CHANGE',
'VOLUME_CHANGE',
'TIMEOUT',
'STOP_TIMEOUT',
'CLICK_VIDEO',
'BEFORE_DESTROY',
'DESTROY'
]
const EVENTS = {}
types.forEach(type => {
EVENTS[type] = `${prefix}${type}`
})
export default EVENTS
export const FULLSCREEN_EVENTS = ['fullscreenchange', 'webkitfullscreenchange', 'mozfullscreenchange', 'msfullscreenchange']
export const START_WAITING_EVENTS = ['loadstart', 'waiting']
export const END_WAITING_EVENTS = ['loadeddata', 'pause', 'canplay', 'canplaythrough', 'ended']
if (device.isEdge) { // Edge waiting后不会触发canplay或者canplaythrough
END_WAITING_EVENTS.push('progress')
}