@elementmints/shadow-plyr 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +398 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/index.umd.js +4 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/types/icons.d.ts +3 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/shadow-plyr.d.ts +15 -0
- package/dist/types/types.d.ts +88 -0
- package/dist/types/utils.d.ts +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export interface VideoPlayerConfig {
|
|
2
|
+
lazy: boolean;
|
|
3
|
+
pauseOnOutOfView: boolean;
|
|
4
|
+
pauseOnTabHide: boolean;
|
|
5
|
+
autoplay: boolean;
|
|
6
|
+
loop: boolean;
|
|
7
|
+
muted: boolean;
|
|
8
|
+
playsinline: boolean;
|
|
9
|
+
preload: 'none' | 'metadata' | 'auto';
|
|
10
|
+
desktopPoster: string;
|
|
11
|
+
mobilePoster: string;
|
|
12
|
+
desktopVideo: string;
|
|
13
|
+
mobileVideo: string;
|
|
14
|
+
videoType: string;
|
|
15
|
+
showControls: boolean;
|
|
16
|
+
controlsType: 'full' | 'minimal' | 'none';
|
|
17
|
+
showPlayPause: boolean;
|
|
18
|
+
showSeekbar: boolean;
|
|
19
|
+
showVolume: boolean;
|
|
20
|
+
showFullscreen: boolean;
|
|
21
|
+
showCenterPlay: boolean;
|
|
22
|
+
showSpeed: boolean;
|
|
23
|
+
speedOptions: number[];
|
|
24
|
+
controlsHideDelay: number;
|
|
25
|
+
seekStep: number;
|
|
26
|
+
lazyThreshold: number;
|
|
27
|
+
pauseThreshold: number;
|
|
28
|
+
theme: 'dark' | 'light';
|
|
29
|
+
accentColor: string;
|
|
30
|
+
controlsBackground: string;
|
|
31
|
+
centerPlayBackground: string;
|
|
32
|
+
centerPlaySize: number;
|
|
33
|
+
showPosterOnEnded: boolean;
|
|
34
|
+
resetOnEnded: boolean;
|
|
35
|
+
posterClickPlay: boolean;
|
|
36
|
+
performanceMode: boolean;
|
|
37
|
+
showTooltips: boolean;
|
|
38
|
+
tooltipPlay: string;
|
|
39
|
+
tooltipPause: string;
|
|
40
|
+
tooltipMute: string;
|
|
41
|
+
tooltipUnmute: string;
|
|
42
|
+
tooltipFullscreen: string;
|
|
43
|
+
tooltipExitFullscreen: string;
|
|
44
|
+
tooltipSpeed: string;
|
|
45
|
+
tooltipCenterPlay: string;
|
|
46
|
+
doubleTapSeek: boolean;
|
|
47
|
+
doubleTapSeekSeconds: number;
|
|
48
|
+
showSeekButtons: boolean;
|
|
49
|
+
seekButtonSeconds: number;
|
|
50
|
+
tripleTapSeek: boolean;
|
|
51
|
+
tripleTapSeconds: number;
|
|
52
|
+
enableTapRipple: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface VideoPlayerState {
|
|
55
|
+
observer: IntersectionObserver | null;
|
|
56
|
+
isInitialized: boolean;
|
|
57
|
+
videoElement: HTMLVideoElement | null;
|
|
58
|
+
isPlaying: boolean;
|
|
59
|
+
isDraggingSeekbar: boolean;
|
|
60
|
+
isDraggingVolume: boolean;
|
|
61
|
+
currentSpeed: number;
|
|
62
|
+
videoLoaded: boolean;
|
|
63
|
+
hasPoster: boolean;
|
|
64
|
+
posterVisible: boolean;
|
|
65
|
+
hasPlayedOnce: boolean;
|
|
66
|
+
wasPlayingBeforeHidden: boolean;
|
|
67
|
+
isPageVisible: boolean;
|
|
68
|
+
rafId: number | null;
|
|
69
|
+
$wrapper: HTMLElement | null;
|
|
70
|
+
$seekbar: HTMLElement | null;
|
|
71
|
+
$seekbarProgress: HTMLElement | null;
|
|
72
|
+
$timeDisplay: HTMLElement | null;
|
|
73
|
+
$volumeProgress: HTMLElement | null;
|
|
74
|
+
$speedMenu: HTMLElement | null;
|
|
75
|
+
$speedText: HTMLElement | null;
|
|
76
|
+
}
|
|
77
|
+
export interface IconSet {
|
|
78
|
+
play: string;
|
|
79
|
+
pause: string;
|
|
80
|
+
volume: string;
|
|
81
|
+
muted: string;
|
|
82
|
+
fullscreen: string;
|
|
83
|
+
exitFullscreen: string;
|
|
84
|
+
speed: string;
|
|
85
|
+
}
|
|
86
|
+
export interface VideoEventDetail {
|
|
87
|
+
[key: string]: any;
|
|
88
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function throttle<T extends (...args: any[]) => any>(fn: T, wait: number): (...args: Parameters<T>) => void;
|
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elementmints/shadow-plyr",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"description": "A fully customizable, responsive web component for video playback with advanced features.",
|
|
9
|
+
"main": "dist/index.umd.js",
|
|
10
|
+
"module": "dist/index.js",
|
|
11
|
+
"types": "dist/types/index.d.ts",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "rollup -c",
|
|
17
|
+
"prepublishOnly": "npm run build",
|
|
18
|
+
"test": "jest --coverage --passWithNoTests",
|
|
19
|
+
"prepare": "husky"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"video",
|
|
23
|
+
"player",
|
|
24
|
+
"web-component",
|
|
25
|
+
"responsive",
|
|
26
|
+
"custom-element",
|
|
27
|
+
"html5-video"
|
|
28
|
+
],
|
|
29
|
+
"author": "Element Mint",
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "https://github.com/elementmint/shadow-plyr.git"
|
|
34
|
+
},
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://github.com/elementmint/shadow-plyr/issues"
|
|
37
|
+
},
|
|
38
|
+
"homepage": "https://github.com/elementmint/shadow-plyr/blob/develop/README.md",
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@commitlint/cli": "^20.4.1",
|
|
41
|
+
"@commitlint/config-conventional": "^20.4.1",
|
|
42
|
+
"@lhci/cli": "^0.15.1",
|
|
43
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
44
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
45
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
46
|
+
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
47
|
+
"@semantic-release/github": "^12.0.6",
|
|
48
|
+
"@semantic-release/npm": "^13.1.4",
|
|
49
|
+
"@semantic-release/release-notes-generator": "^14.1.0",
|
|
50
|
+
"@types/dompurify": "^3.0.5",
|
|
51
|
+
"bundlesize": "^0.18.2",
|
|
52
|
+
"dompurify": "^3.3.1",
|
|
53
|
+
"husky": "^9.1.7",
|
|
54
|
+
"jest": "^30.2.0",
|
|
55
|
+
"rollup": "^4.12.0",
|
|
56
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
57
|
+
"semantic-release": "^25.0.3",
|
|
58
|
+
"serve": "^14.2.5",
|
|
59
|
+
"tslib": "^2.8.1",
|
|
60
|
+
"typescript": "^5.3.3"
|
|
61
|
+
},
|
|
62
|
+
"bundlesize": [
|
|
63
|
+
{
|
|
64
|
+
"path": "./dist/*.js",
|
|
65
|
+
"maxSize": "30 kB"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|