playron 1.0.31 → 1.0.32
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/dist/index.d.ts +1934 -107
- package/package.json +2 -4
- package/dist/Docs.d.ts +0 -2
- package/dist/Docs.d.ts.map +0 -1
- package/dist/Why.d.ts +0 -2
- package/dist/Why.d.ts.map +0 -1
- package/dist/components/PlayerConfig.d.ts +0 -34
- package/dist/components/PlayerConfig.d.ts.map +0 -1
- package/dist/components/PlayronControls.d.ts +0 -26
- package/dist/components/PlayronControls.d.ts.map +0 -1
- package/dist/components/PlayronPlayer.d.ts +0 -37
- package/dist/components/PlayronPlayer.d.ts.map +0 -1
- package/dist/components/SiteHeader.d.ts +0 -6
- package/dist/components/SiteHeader.d.ts.map +0 -1
- package/dist/constants/sample-intro-outro.d.ts +0 -3
- package/dist/constants/sample-intro-outro.d.ts.map +0 -1
- package/dist/constants/source.d.ts +0 -2
- package/dist/constants/source.d.ts.map +0 -1
- package/dist/constants/sports-events.d.ts +0 -58
- package/dist/constants/sports-events.d.ts.map +0 -1
- package/dist/context/PlayerContext.d.ts +0 -3
- package/dist/context/PlayerContext.d.ts.map +0 -1
- package/dist/context/PlayerMethodsContext.d.ts +0 -63
- package/dist/context/PlayerMethodsContext.d.ts.map +0 -1
- package/dist/context/PlayerProvider.d.ts +0 -9
- package/dist/context/PlayerProvider.d.ts.map +0 -1
- package/dist/context/PlayerStateContext.d.ts +0 -4
- package/dist/context/PlayerStateContext.d.ts.map +0 -1
- package/dist/context/PlayronContext.d.ts +0 -100
- package/dist/context/PlayronContext.d.ts.map +0 -1
- package/dist/context/SubtitleStyleContext.d.ts +0 -22
- package/dist/context/SubtitleStyleContext.d.ts.map +0 -1
- package/dist/core/ConfigManager.d.ts +0 -78
- package/dist/core/ConfigManager.d.ts.map +0 -1
- package/dist/core/ErrorManager.d.ts +0 -22
- package/dist/core/ErrorManager.d.ts.map +0 -1
- package/dist/core/EventBus.d.ts +0 -32
- package/dist/core/EventBus.d.ts.map +0 -1
- package/dist/core/PlayerCore.d.ts +0 -188
- package/dist/core/PlayerCore.d.ts.map +0 -1
- package/dist/core/PlayronEventEmitter.d.ts +0 -168
- package/dist/core/PlayronEventEmitter.d.ts.map +0 -1
- package/dist/core/PluginSystem.d.ts +0 -111
- package/dist/core/PluginSystem.d.ts.map +0 -1
- package/dist/core/StallDetector.d.ts +0 -27
- package/dist/core/StallDetector.d.ts.map +0 -1
- package/dist/core/StateManager.d.ts +0 -90
- package/dist/core/StateManager.d.ts.map +0 -1
- package/dist/core/VideoEngine.d.ts +0 -92
- package/dist/core/VideoEngine.d.ts.map +0 -1
- package/dist/core/adaptive/StreamDetector.d.ts +0 -73
- package/dist/core/adaptive/StreamDetector.d.ts.map +0 -1
- package/dist/core/cast/ChromecastManager.d.ts +0 -192
- package/dist/core/cast/ChromecastManager.d.ts.map +0 -1
- package/dist/core/drm/DrmCapabilityProbe.d.ts +0 -13
- package/dist/core/drm/DrmCapabilityProbe.d.ts.map +0 -1
- package/dist/core/drm/DrmManager.d.ts +0 -29
- package/dist/core/drm/DrmManager.d.ts.map +0 -1
- package/dist/core/drm/LicenseManager.d.ts +0 -28
- package/dist/core/drm/LicenseManager.d.ts.map +0 -1
- package/dist/core/drm/adapters/BaseDrmAdapter.d.ts +0 -33
- package/dist/core/drm/adapters/BaseDrmAdapter.d.ts.map +0 -1
- package/dist/core/drm/adapters/FairPlayAdapter.d.ts +0 -23
- package/dist/core/drm/adapters/FairPlayAdapter.d.ts.map +0 -1
- package/dist/core/drm/adapters/PlayReadyAdapter.d.ts +0 -20
- package/dist/core/drm/adapters/PlayReadyAdapter.d.ts.map +0 -1
- package/dist/core/drm/adapters/WidevineAdapter.d.ts +0 -18
- package/dist/core/drm/adapters/WidevineAdapter.d.ts.map +0 -1
- package/dist/core/license/LicenseValidator.d.ts +0 -30
- package/dist/core/license/LicenseValidator.d.ts.map +0 -1
- package/dist/core/network/index.d.ts +0 -6
- package/dist/core/network/index.d.ts.map +0 -1
- package/dist/core/streaming/DashEngine.d.ts +0 -149
- package/dist/core/streaming/DashEngine.d.ts.map +0 -1
- package/dist/core/streaming/HlsEngine.d.ts +0 -168
- package/dist/core/streaming/HlsEngine.d.ts.map +0 -1
- package/dist/core/streaming/SubtitleManager.d.ts +0 -92
- package/dist/core/streaming/SubtitleManager.d.ts.map +0 -1
- package/dist/core/streaming/ThumbnailManager.d.ts +0 -44
- package/dist/core/streaming/ThumbnailManager.d.ts.map +0 -1
- package/dist/core/streaming/index.d.ts +0 -11
- package/dist/core/streaming/index.d.ts.map +0 -1
- package/dist/core/streaming/parsers/TtmlParser.d.ts +0 -46
- package/dist/core/streaming/parsers/TtmlParser.d.ts.map +0 -1
- package/dist/core/streaming/parsers/WebVttParser.d.ts +0 -56
- package/dist/core/streaming/parsers/WebVttParser.d.ts.map +0 -1
- package/dist/hooks/useClickOutside.d.ts +0 -4
- package/dist/hooks/useClickOutside.d.ts.map +0 -1
- package/dist/hooks/useKeyboardControls.d.ts +0 -20
- package/dist/hooks/useKeyboardControls.d.ts.map +0 -1
- package/dist/hooks/useMobileGestures.d.ts +0 -17
- package/dist/hooks/useMobileGestures.d.ts.map +0 -1
- package/dist/hooks/useMouseActivity.d.ts +0 -10
- package/dist/hooks/useMouseActivity.d.ts.map +0 -1
- package/dist/hooks/usePlayer.d.ts +0 -6
- package/dist/hooks/usePlayer.d.ts.map +0 -1
- package/dist/hooks/usePlayerMethods.d.ts +0 -6
- package/dist/hooks/usePlayerMethods.d.ts.map +0 -1
- package/dist/hooks/usePlayerState.d.ts +0 -11
- package/dist/hooks/usePlayerState.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/layout/ControlsContainer.d.ts +0 -9
- package/dist/layout/ControlsContainer.d.ts.map +0 -1
- package/dist/layout/ControlsContainer.responsive.d.ts +0 -8
- package/dist/layout/ControlsContainer.responsive.d.ts.map +0 -1
- package/dist/layout/SeekBarContainer.d.ts +0 -16
- package/dist/layout/SeekBarContainer.d.ts.map +0 -1
- package/dist/plugins/AdPlugin.d.ts +0 -8
- package/dist/plugins/AdPlugin.d.ts.map +0 -1
- package/dist/plugins/AnalyticsPlugin.d.ts +0 -50
- package/dist/plugins/AnalyticsPlugin.d.ts.map +0 -1
- package/dist/plugins/PluginManager.d.ts +0 -2
- package/dist/plugins/PluginManager.d.ts.map +0 -1
- package/dist/plugins/SocialPlugin.d.ts +0 -2
- package/dist/plugins/SocialPlugin.d.ts.map +0 -1
- package/dist/plugins/ads/AdManager.d.ts +0 -79
- package/dist/plugins/ads/AdManager.d.ts.map +0 -1
- package/dist/plugins/ads/AdPlayer.d.ts +0 -33
- package/dist/plugins/ads/AdPlayer.d.ts.map +0 -1
- package/dist/plugins/ads/AdTracker.d.ts +0 -34
- package/dist/plugins/ads/AdTracker.d.ts.map +0 -1
- package/dist/plugins/ads/VASTParser.d.ts +0 -52
- package/dist/plugins/ads/VASTParser.d.ts.map +0 -1
- package/dist/plugins/ads/VMAPParser.d.ts +0 -31
- package/dist/plugins/ads/VMAPParser.d.ts.map +0 -1
- package/dist/plugins/ads/types.d.ts +0 -108
- package/dist/plugins/ads/types.d.ts.map +0 -1
- package/dist/poster.png +0 -0
- package/dist/test-ad.xml +0 -37
- package/dist/test-vmap.xml +0 -30
- package/dist/types/analytics.d.ts +0 -86
- package/dist/types/analytics.d.ts.map +0 -1
- package/dist/types/chapters.types.d.ts +0 -17
- package/dist/types/chapters.types.d.ts.map +0 -1
- package/dist/types/config.d.ts +0 -23
- package/dist/types/config.d.ts.map +0 -1
- package/dist/types/config.types.d.ts +0 -277
- package/dist/types/config.types.d.ts.map +0 -1
- package/dist/types/controlbar.types.d.ts +0 -5
- package/dist/types/controlbar.types.d.ts.map +0 -1
- package/dist/types/drm.types.d.ts +0 -163
- package/dist/types/drm.types.d.ts.map +0 -1
- package/dist/types/events.d.ts +0 -36
- package/dist/types/events.d.ts.map +0 -1
- package/dist/types/extended.types.d.ts +0 -85
- package/dist/types/extended.types.d.ts.map +0 -1
- package/dist/types/manifest.types.d.ts +0 -297
- package/dist/types/manifest.types.d.ts.map +0 -1
- package/dist/types/playbutton.types.d.ts +0 -2
- package/dist/types/playbutton.types.d.ts.map +0 -1
- package/dist/types/player.types.d.ts +0 -21
- package/dist/types/player.types.d.ts.map +0 -1
- package/dist/types/seekbar.types.d.ts +0 -5
- package/dist/types/seekbar.types.d.ts.map +0 -1
- package/dist/types/streaming.types.d.ts +0 -168
- package/dist/types/streaming.types.d.ts.map +0 -1
- package/dist/types/timeline.types.d.ts +0 -46
- package/dist/types/timeline.types.d.ts.map +0 -1
- package/dist/types/video-events.d.ts +0 -51
- package/dist/types/video-events.d.ts.map +0 -1
- package/dist/ui/Common/BufferingIndicator.d.ts +0 -2
- package/dist/ui/Common/BufferingIndicator.d.ts.map +0 -1
- package/dist/ui/Common/ControlBar.d.ts +0 -3
- package/dist/ui/Common/ControlBar.d.ts.map +0 -1
- package/dist/ui/Common/ControlBar.responsive.d.ts +0 -3
- package/dist/ui/Common/ControlBar.responsive.d.ts.map +0 -1
- package/dist/ui/Common/Dropdown/Dropdown.d.ts +0 -14
- package/dist/ui/Common/Dropdown/Dropdown.d.ts.map +0 -1
- package/dist/ui/Common/Dropdown/DropdownItem.d.ts +0 -11
- package/dist/ui/Common/Dropdown/DropdownItem.d.ts.map +0 -1
- package/dist/ui/Common/Dropdown/DropdownPanel.d.ts +0 -9
- package/dist/ui/Common/Dropdown/DropdownPanel.d.ts.map +0 -1
- package/dist/ui/Common/Dropdown/DropdownTrigger.d.ts +0 -7
- package/dist/ui/Common/Dropdown/DropdownTrigger.d.ts.map +0 -1
- package/dist/ui/Common/LoadingSpinner.d.ts +0 -6
- package/dist/ui/Common/LoadingSpinner.d.ts.map +0 -1
- package/dist/ui/Common/Overlay.d.ts +0 -11
- package/dist/ui/Common/Overlay.d.ts.map +0 -1
- package/dist/ui/Common/SeekBar.d.ts +0 -41
- package/dist/ui/Common/SeekBar.d.ts.map +0 -1
- package/dist/ui/Common/SeekBar.responsive.d.ts +0 -10
- package/dist/ui/Common/SeekBar.responsive.d.ts.map +0 -1
- package/dist/ui/Common/TimeDisplay.d.ts +0 -2
- package/dist/ui/Common/TimeDisplay.d.ts.map +0 -1
- package/dist/ui/Common/TimelineMarker.d.ts +0 -11
- package/dist/ui/Common/TimelineMarker.d.ts.map +0 -1
- package/dist/ui/Common/Tooltip.d.ts +0 -2
- package/dist/ui/Common/Tooltip.d.ts.map +0 -1
- package/dist/ui/Common/VolumePanel.d.ts +0 -2
- package/dist/ui/Common/VolumePanel.d.ts.map +0 -1
- package/dist/ui/Controls/AudioTrackSelector.d.ts +0 -2
- package/dist/ui/Controls/AudioTrackSelector.d.ts.map +0 -1
- package/dist/ui/Controls/CaptionsButton.d.ts +0 -2
- package/dist/ui/Controls/CaptionsButton.d.ts.map +0 -1
- package/dist/ui/Controls/CastButton.d.ts +0 -17
- package/dist/ui/Controls/CastButton.d.ts.map +0 -1
- package/dist/ui/Controls/ChromecastButton.d.ts +0 -18
- package/dist/ui/Controls/ChromecastButton.d.ts.map +0 -1
- package/dist/ui/Controls/DownloadButton.d.ts +0 -2
- package/dist/ui/Controls/DownloadButton.d.ts.map +0 -1
- package/dist/ui/Controls/EpisodeSelector.d.ts +0 -2
- package/dist/ui/Controls/EpisodeSelector.d.ts.map +0 -1
- package/dist/ui/Controls/FullscreenButton.d.ts +0 -13
- package/dist/ui/Controls/FullscreenButton.d.ts.map +0 -1
- package/dist/ui/Controls/JumpToLiveButton.d.ts +0 -2
- package/dist/ui/Controls/JumpToLiveButton.d.ts.map +0 -1
- package/dist/ui/Controls/LiveLatencyDisplay.d.ts +0 -2
- package/dist/ui/Controls/LiveLatencyDisplay.d.ts.map +0 -1
- package/dist/ui/Controls/MuteButton.d.ts +0 -5
- package/dist/ui/Controls/MuteButton.d.ts.map +0 -1
- package/dist/ui/Controls/NextEpisodeButton.d.ts +0 -7
- package/dist/ui/Controls/NextEpisodeButton.d.ts.map +0 -1
- package/dist/ui/Controls/PipButton.d.ts +0 -5
- package/dist/ui/Controls/PipButton.d.ts.map +0 -1
- package/dist/ui/Controls/PlayButton.d.ts +0 -13
- package/dist/ui/Controls/PlayButton.d.ts.map +0 -1
- package/dist/ui/Controls/PlaybackSpeedSelector.d.ts +0 -2
- package/dist/ui/Controls/PlaybackSpeedSelector.d.ts.map +0 -1
- package/dist/ui/Controls/PlaylistButton.d.ts +0 -2
- package/dist/ui/Controls/PlaylistButton.d.ts.map +0 -1
- package/dist/ui/Controls/QualitySelector.d.ts +0 -2
- package/dist/ui/Controls/QualitySelector.d.ts.map +0 -1
- package/dist/ui/Controls/SeekBar.d.ts +0 -2
- package/dist/ui/Controls/SeekBar.d.ts.map +0 -1
- package/dist/ui/Controls/SeekBarProgress.d.ts +0 -2
- package/dist/ui/Controls/SeekBarProgress.d.ts.map +0 -1
- package/dist/ui/Controls/SettingsButton.d.ts +0 -2
- package/dist/ui/Controls/SettingsButton.d.ts.map +0 -1
- package/dist/ui/Controls/SettingsPanel.d.ts +0 -49
- package/dist/ui/Controls/SettingsPanel.d.ts.map +0 -1
- package/dist/ui/Controls/SkipBackwardButton.d.ts +0 -12
- package/dist/ui/Controls/SkipBackwardButton.d.ts.map +0 -1
- package/dist/ui/Controls/SkipForwardButton.d.ts +0 -12
- package/dist/ui/Controls/SkipForwardButton.d.ts.map +0 -1
- package/dist/ui/Controls/SkipIntroButton.d.ts +0 -7
- package/dist/ui/Controls/SkipIntroButton.d.ts.map +0 -1
- package/dist/ui/Controls/SubtitleOverlay.d.ts +0 -6
- package/dist/ui/Controls/SubtitleOverlay.d.ts.map +0 -1
- package/dist/ui/Controls/SubtitlesMenu.d.ts +0 -2
- package/dist/ui/Controls/SubtitlesMenu.d.ts.map +0 -1
- package/dist/ui/Controls/TheaterModeButton.d.ts +0 -2
- package/dist/ui/Controls/TheaterModeButton.d.ts.map +0 -1
- package/dist/ui/Controls/TimeDisplay.d.ts +0 -5
- package/dist/ui/Controls/TimeDisplay.d.ts.map +0 -1
- package/dist/ui/Controls/VolumeControl.d.ts +0 -33
- package/dist/ui/Controls/VolumeControl.d.ts.map +0 -1
- package/dist/ui/Controls/VolumeSlider.d.ts +0 -2
- package/dist/ui/Controls/VolumeSlider.d.ts.map +0 -1
- package/dist/ui/Overlay/ContextMenu.d.ts +0 -35
- package/dist/ui/Overlay/ContextMenu.d.ts.map +0 -1
- package/dist/ui/Overlay/EndCard.d.ts +0 -11
- package/dist/ui/Overlay/EndCard.d.ts.map +0 -1
- package/dist/ui/Overlay/ErrorOverlay.d.ts +0 -13
- package/dist/ui/Overlay/ErrorOverlay.d.ts.map +0 -1
- package/dist/ui/Overlay/GestureHintOverlay.d.ts +0 -13
- package/dist/ui/Overlay/GestureHintOverlay.d.ts.map +0 -1
- package/dist/ui/Overlay/KeyboardShortcutsOverlay.d.ts +0 -7
- package/dist/ui/Overlay/KeyboardShortcutsOverlay.d.ts.map +0 -1
- package/dist/ui/Overlay/LicenseOverlay.d.ts +0 -12
- package/dist/ui/Overlay/LicenseOverlay.d.ts.map +0 -1
- package/dist/ui/Overlay/VideoOverlay.d.ts +0 -9
- package/dist/ui/Overlay/VideoOverlay.d.ts.map +0 -1
- package/dist/ui/Player.d.ts +0 -19
- package/dist/ui/Player.d.ts.map +0 -1
- package/dist/vite.svg +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,107 +1,1934 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export
|
|
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
|
-
export
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
export type
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
declare
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
1
|
+
import { Context } from 'react';
|
|
2
|
+
import { FunctionComponent } from 'react';
|
|
3
|
+
import { JSX } from 'react/jsx-runtime';
|
|
4
|
+
import { ReactNode } from 'react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Parsed VAST ad data
|
|
8
|
+
*/
|
|
9
|
+
export declare interface Ad {
|
|
10
|
+
id: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
duration: number;
|
|
13
|
+
mediaFile: string;
|
|
14
|
+
clickThrough?: string;
|
|
15
|
+
trackingEvents: {
|
|
16
|
+
impression?: string[];
|
|
17
|
+
start?: string[];
|
|
18
|
+
complete?: string[];
|
|
19
|
+
skip?: string[];
|
|
20
|
+
firstQuartile?: string[];
|
|
21
|
+
midpoint?: string[];
|
|
22
|
+
thirdQuartile?: string[];
|
|
23
|
+
pause?: string[];
|
|
24
|
+
resume?: string[];
|
|
25
|
+
};
|
|
26
|
+
errorUrls?: string[];
|
|
27
|
+
/** Companion banners to display alongside the linear ad */
|
|
28
|
+
companions?: CompanionAd[];
|
|
29
|
+
/** Whether this is a VPAID creative */
|
|
30
|
+
isVpaid?: boolean;
|
|
31
|
+
/** VPAID JavaScript URL (apiFramework=VPAID) */
|
|
32
|
+
vpaidUrl?: string;
|
|
33
|
+
/** Position within an ad pod (from sequence attribute) */
|
|
34
|
+
podSequence?: number;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Ads configuration (from user config)
|
|
39
|
+
*/
|
|
40
|
+
export declare interface AdConfig {
|
|
41
|
+
enabled: boolean;
|
|
42
|
+
vastUrl?: string;
|
|
43
|
+
vmapUrl?: string;
|
|
44
|
+
skipAfter?: number;
|
|
45
|
+
timeout?: number;
|
|
46
|
+
maxWrapperDepth?: number;
|
|
47
|
+
ui?: AdUIConfig;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Ad position
|
|
52
|
+
*/
|
|
53
|
+
export declare type AdPosition = 'preroll' | 'midroll' | 'postroll';
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Simple Ad System Types
|
|
57
|
+
*/
|
|
58
|
+
/**
|
|
59
|
+
* Ad UI Configuration (optional customization)
|
|
60
|
+
*/
|
|
61
|
+
declare interface AdUIConfig {
|
|
62
|
+
showLabel?: boolean;
|
|
63
|
+
showCountdown?: boolean;
|
|
64
|
+
showSkipButton?: boolean;
|
|
65
|
+
labelText?: string;
|
|
66
|
+
labelPosition?: 'top-left' | 'top-right';
|
|
67
|
+
countdownPosition?: 'top-left' | 'top-right';
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export declare type AllPlayerEvents = PlayEvent | PauseEvent | MuteEvent | VolumeChangeEvent;
|
|
71
|
+
|
|
72
|
+
export declare function CastButton({ label, className }: CastButtonProps): JSX.Element | null;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* AirPlay / Cast Button
|
|
76
|
+
*
|
|
77
|
+
* Renders an AirPlay button (Safari WebKit only).
|
|
78
|
+
* Invisible in non-Safari browsers; hidden when no AirPlay device is available.
|
|
79
|
+
*
|
|
80
|
+
* Uses PlayerCore.showAirPlayPicker() to trigger the system UI.
|
|
81
|
+
* Listens to `airplaychange` events to track availability and active state.
|
|
82
|
+
*/
|
|
83
|
+
declare interface CastButtonProps {
|
|
84
|
+
/** Tooltip label */
|
|
85
|
+
label?: string;
|
|
86
|
+
className?: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export declare interface CastState {
|
|
90
|
+
isAvailable: boolean;
|
|
91
|
+
isActive: boolean;
|
|
92
|
+
/** 'not_connected' | 'connecting' | 'connected' | 'unavailable' */
|
|
93
|
+
state: 'not_connected' | 'connecting' | 'connected' | 'unavailable';
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export declare interface Chapter {
|
|
97
|
+
id: string;
|
|
98
|
+
title: string;
|
|
99
|
+
startTime: number;
|
|
100
|
+
endTime?: number;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export declare function ChromecastButton({ label, className, }: ChromecastButtonProps): JSX.Element | null;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* ChromecastButton
|
|
107
|
+
*
|
|
108
|
+
* Shows a Google Cast icon when Chromecast devices are available.
|
|
109
|
+
* Hidden when no Cast-capable devices are nearby or when the Cast SDK
|
|
110
|
+
* has not been initialised (setupChromecast() not called on PlayerCore).
|
|
111
|
+
*
|
|
112
|
+
* Listens to `castchange` events emitted by PlayerCore / ChromecastManager.
|
|
113
|
+
* Button is visually active (tinted) while a session is connected.
|
|
114
|
+
*/
|
|
115
|
+
declare interface ChromecastButtonProps {
|
|
116
|
+
/** Tooltip label (default: 'Cast') */
|
|
117
|
+
label?: string;
|
|
118
|
+
className?: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export declare class ChromecastManager {
|
|
122
|
+
private readonly appId;
|
|
123
|
+
private readonly onChange;
|
|
124
|
+
private isAvailable;
|
|
125
|
+
private sessionActive;
|
|
126
|
+
private sdkLoaded;
|
|
127
|
+
/** Bound Cast state-change handler (needed for removeEventListener). */
|
|
128
|
+
private castStateHandler;
|
|
129
|
+
constructor(options: ChromecastManagerOptions);
|
|
130
|
+
/**
|
|
131
|
+
* Load the Google Cast SDK and initialise the Cast context.
|
|
132
|
+
* Safe to call multiple times — idempotent.
|
|
133
|
+
*/
|
|
134
|
+
setup(): void;
|
|
135
|
+
/**
|
|
136
|
+
* Open the Cast device picker dialog.
|
|
137
|
+
* Resolves when the user selects a device (or dismisses).
|
|
138
|
+
*/
|
|
139
|
+
requestSession(): Promise<void>;
|
|
140
|
+
/**
|
|
141
|
+
* End the current Cast session (stop casting).
|
|
142
|
+
* @param stopCasting Whether to stop playback on the receiver (true) or leave it running.
|
|
143
|
+
*/
|
|
144
|
+
endSession(stopCasting?: boolean): void;
|
|
145
|
+
/**
|
|
146
|
+
* Load a media URL on the active Cast receiver.
|
|
147
|
+
* Must be called AFTER a session is established.
|
|
148
|
+
*
|
|
149
|
+
* @param src Fully qualified media URL
|
|
150
|
+
* @param contentType MIME type (e.g. 'application/x-mpegURL', 'video/mp4')
|
|
151
|
+
* @param startTime Playhead position in seconds (default 0)
|
|
152
|
+
* @param isLive Whether the stream is live (affects receiver UI)
|
|
153
|
+
*/
|
|
154
|
+
loadMedia(src: string, contentType?: string, startTime?: number, isLive?: boolean): Promise<void>;
|
|
155
|
+
/**
|
|
156
|
+
* Seek the Cast receiver to the given time.
|
|
157
|
+
* No-op when cast is not active.
|
|
158
|
+
*/
|
|
159
|
+
syncTime(time: number): void;
|
|
160
|
+
/**
|
|
161
|
+
* Sync volume / mute state to the Cast receiver.
|
|
162
|
+
* No-op when cast is not active.
|
|
163
|
+
*/
|
|
164
|
+
syncVolume(volume: number, muted: boolean): Promise<void>;
|
|
165
|
+
/** Returns true if at least one Cast device is available. */
|
|
166
|
+
isCastAvailable(): boolean;
|
|
167
|
+
/** Returns true if a Cast session is currently active. */
|
|
168
|
+
isCastActive(): boolean;
|
|
169
|
+
/** Current cast state snapshot. */
|
|
170
|
+
getState(): CastState;
|
|
171
|
+
/** Remove all event listeners. Does NOT end the cast session. */
|
|
172
|
+
destroy(): void;
|
|
173
|
+
private getContext;
|
|
174
|
+
private initContext;
|
|
175
|
+
private syncState;
|
|
176
|
+
private emitState;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export declare interface ChromecastManagerOptions {
|
|
180
|
+
/**
|
|
181
|
+
* Cast receiver application ID.
|
|
182
|
+
* Defaults to `DEFAULT_MEDIA_RECEIVER_APP_ID` ('CC1AD845').
|
|
183
|
+
*/
|
|
184
|
+
appId?: string;
|
|
185
|
+
/** Called whenever cast availability or session state changes. */
|
|
186
|
+
onChange: (state: CastState) => void;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Companion banner (displayed alongside the ad)
|
|
191
|
+
*/
|
|
192
|
+
declare interface CompanionAd {
|
|
193
|
+
id?: string;
|
|
194
|
+
width: number;
|
|
195
|
+
height: number;
|
|
196
|
+
/** Static image / SWF URL */
|
|
197
|
+
staticResource?: string;
|
|
198
|
+
/** Raw HTML snippet */
|
|
199
|
+
htmlResource?: string;
|
|
200
|
+
/** IFrame URL */
|
|
201
|
+
iFrameResource?: string;
|
|
202
|
+
/** MIME type of the staticResource */
|
|
203
|
+
type?: string;
|
|
204
|
+
/** Click-through URL */
|
|
205
|
+
clickThrough?: string;
|
|
206
|
+
/** Alt text for image companions */
|
|
207
|
+
altText?: string;
|
|
208
|
+
/** Tracking URLs to fire on companion view */
|
|
209
|
+
viewTrackingUrls?: string[];
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
declare class ConfigManager {
|
|
213
|
+
private config;
|
|
214
|
+
private defaultConfig;
|
|
215
|
+
constructor(config: VanillaPlayerConfig);
|
|
216
|
+
/**
|
|
217
|
+
* Varsayılan konfigürasyonu döndür
|
|
218
|
+
*/
|
|
219
|
+
private getDefaultConfig;
|
|
220
|
+
/**
|
|
221
|
+
* Konfigürasyonları birleştir
|
|
222
|
+
*/
|
|
223
|
+
private mergeConfig;
|
|
224
|
+
/**
|
|
225
|
+
* Konfigürasyonu doğrula
|
|
226
|
+
*/
|
|
227
|
+
private validateConfig;
|
|
228
|
+
/**
|
|
229
|
+
* Konfigürasyonu güncelle
|
|
230
|
+
*/
|
|
231
|
+
updateConfig(updates: Partial<VanillaPlayerConfig>): void;
|
|
232
|
+
/**
|
|
233
|
+
* Mevcut konfigürasyonu döndür
|
|
234
|
+
*/
|
|
235
|
+
getConfig(): VanillaPlayerConfig;
|
|
236
|
+
/**
|
|
237
|
+
* Belirli bir konfigürasyon değerini al
|
|
238
|
+
*/
|
|
239
|
+
get<K extends keyof VanillaPlayerConfig>(key: K): VanillaPlayerConfig[K];
|
|
240
|
+
/**
|
|
241
|
+
* Belirli bir konfigürasyon değerini ayarla
|
|
242
|
+
*/
|
|
243
|
+
set<K extends keyof VanillaPlayerConfig>(key: K, value: VanillaPlayerConfig[K]): void;
|
|
244
|
+
/**
|
|
245
|
+
* Container element'ini döndür
|
|
246
|
+
*/
|
|
247
|
+
getContainer(): HTMLElement | null;
|
|
248
|
+
/**
|
|
249
|
+
* Video boyutlarını döndür
|
|
250
|
+
*/
|
|
251
|
+
getDimensions(): {
|
|
252
|
+
width: number;
|
|
253
|
+
height: number;
|
|
254
|
+
};
|
|
255
|
+
/**
|
|
256
|
+
* Konfigürasyonu sıfırla
|
|
257
|
+
*/
|
|
258
|
+
reset(): void;
|
|
259
|
+
/**
|
|
260
|
+
* Konfigürasyonu export et
|
|
261
|
+
*/
|
|
262
|
+
export(): string;
|
|
263
|
+
/**
|
|
264
|
+
* Konfigürasyonu import et
|
|
265
|
+
*/
|
|
266
|
+
import(configString: string): void;
|
|
267
|
+
/**
|
|
268
|
+
* Konfigürasyon değişikliklerini dinle
|
|
269
|
+
*/
|
|
270
|
+
private listeners;
|
|
271
|
+
/**
|
|
272
|
+
* Konfigürasyon değişiklik dinleyicisi ekle
|
|
273
|
+
*/
|
|
274
|
+
onChange(callback: (config: VanillaPlayerConfig) => void): void;
|
|
275
|
+
/**
|
|
276
|
+
* Konfigürasyon değişiklik dinleyicisini kaldır
|
|
277
|
+
*/
|
|
278
|
+
offChange(callback: (config: VanillaPlayerConfig) => void): void;
|
|
279
|
+
/**
|
|
280
|
+
* Konfigürasyon değişikliklerini bildir
|
|
281
|
+
*/
|
|
282
|
+
private notifyChange;
|
|
283
|
+
/**
|
|
284
|
+
* Konfigürasyonu güncelle ve değişiklikleri bildir
|
|
285
|
+
*/
|
|
286
|
+
updateConfigAndNotify(updates: Partial<VanillaPlayerConfig>): void;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export declare function ContextMenu({ x, y, isOpen, onClose, actions, theme }: ContextMenuProps): JSX.Element | null;
|
|
290
|
+
|
|
291
|
+
export declare interface ContextMenuAction {
|
|
292
|
+
label: string;
|
|
293
|
+
icon?: React.ReactNode;
|
|
294
|
+
onClick: () => void;
|
|
295
|
+
dividerAfter?: boolean;
|
|
296
|
+
danger?: boolean;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
declare interface ContextMenuProps {
|
|
300
|
+
x: number;
|
|
301
|
+
y: number;
|
|
302
|
+
isOpen: boolean;
|
|
303
|
+
onClose: () => void;
|
|
304
|
+
actions: ContextMenuAction[];
|
|
305
|
+
theme?: ContextMenuTheme;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/** Customize the visual appearance of the ContextMenu. */
|
|
309
|
+
export declare interface ContextMenuTheme {
|
|
310
|
+
/** Panel background. Default: 'rgba(12, 12, 20, 0.97)' */
|
|
311
|
+
background?: string;
|
|
312
|
+
/** Panel border color. Default: 'rgba(255,255,255,0.1)' */
|
|
313
|
+
borderColor?: string;
|
|
314
|
+
/** Normal item text color. Default: '#fff' */
|
|
315
|
+
textColor?: string;
|
|
316
|
+
/** Danger item color. Default: '#f87171' */
|
|
317
|
+
dangerColor?: string;
|
|
318
|
+
/** Row hover background. Default: 'rgba(255,255,255,0.07)' */
|
|
319
|
+
hoverBackground?: string;
|
|
320
|
+
/** Icon pill background. Default: 'rgba(255,255,255,0.08)' */
|
|
321
|
+
iconBackground?: string;
|
|
322
|
+
/** Divider line color. Default: 'rgba(255,255,255,0.07)' */
|
|
323
|
+
dividerColor?: string;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
export declare function ControlBar({ children }: ControlBarProps): JSX.Element;
|
|
327
|
+
|
|
328
|
+
export declare interface ControlBarProps {
|
|
329
|
+
children?: ReactNode;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export declare const ControlsContainer: FunctionComponent<ControlsContainerProps>;
|
|
333
|
+
|
|
334
|
+
declare interface ControlsContainerProps {
|
|
335
|
+
/** Optional override — if omitted, live/VOD is auto-detected from stream state */
|
|
336
|
+
mode?: PlayerMode;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
export declare const ControlsVisibilityContext: Context<boolean>;
|
|
340
|
+
|
|
341
|
+
export declare function EndCard({ isVisible, onNextEpisode, onDismiss, countdownSec, nextTitle, thumbnail, }: EndCardProps): JSX.Element | null;
|
|
342
|
+
|
|
343
|
+
declare interface EndCardProps {
|
|
344
|
+
isVisible: boolean;
|
|
345
|
+
onNextEpisode: () => void;
|
|
346
|
+
onDismiss: () => void;
|
|
347
|
+
countdownSec?: number;
|
|
348
|
+
nextTitle?: string;
|
|
349
|
+
thumbnail?: string;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export declare class EventBus {
|
|
353
|
+
private listeners;
|
|
354
|
+
/**
|
|
355
|
+
* Event dinleyicisi ekle
|
|
356
|
+
* @param eventType Event tipi
|
|
357
|
+
* @param callback Event gerçekleştiğinde çağrılacak fonksiyon
|
|
358
|
+
*/
|
|
359
|
+
on<T extends AllPlayerEvents>(eventType: T['type'], callback: EventCallback<T>): void;
|
|
360
|
+
/**
|
|
361
|
+
* Event dinleyicisini kaldır
|
|
362
|
+
* @param eventType Event tipi
|
|
363
|
+
* @param callback Kaldırılacak fonksiyon
|
|
364
|
+
*/
|
|
365
|
+
off<T extends AllPlayerEvents>(eventType: T['type'], callback: EventCallback<T>): void;
|
|
366
|
+
/**
|
|
367
|
+
* Event gönder
|
|
368
|
+
* @param event Gönderilecek event
|
|
369
|
+
*/
|
|
370
|
+
emit<T extends AllPlayerEvents>(event: T): void;
|
|
371
|
+
/**
|
|
372
|
+
* Tüm dinleyicileri temizle
|
|
373
|
+
*/
|
|
374
|
+
clear(): void;
|
|
375
|
+
/**
|
|
376
|
+
* Belirli bir event tipinin dinleyici sayısını döndür
|
|
377
|
+
* @param eventType Event tipi
|
|
378
|
+
*/
|
|
379
|
+
listenerCount(eventType: string): number;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
export declare const eventBus: EventBus;
|
|
383
|
+
|
|
384
|
+
export declare type EventCallback<T = any> = (event: T) => void;
|
|
385
|
+
|
|
386
|
+
export declare function FullscreenButton({ className, onClick, iconSize, hoverBackground, enterIcon, exitIcon, style, ...props }: FullscreenButtonProps): JSX.Element;
|
|
387
|
+
|
|
388
|
+
declare interface FullscreenButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
389
|
+
/** Icon size in px. Default: 18 */
|
|
390
|
+
iconSize?: number;
|
|
391
|
+
/** Hover background color. Pass false to disable hover background. */
|
|
392
|
+
hoverBackground?: string | boolean;
|
|
393
|
+
/** Custom icon shown when not in fullscreen (enter fullscreen). */
|
|
394
|
+
enterIcon?: React.ReactNode;
|
|
395
|
+
/** Custom icon shown when in fullscreen (exit fullscreen). */
|
|
396
|
+
exitIcon?: React.ReactNode;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
declare interface GestureHint {
|
|
400
|
+
type: 'seek-forward' | 'seek-backward';
|
|
401
|
+
value: string;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
export declare function GestureHintOverlay({ type, value }: GestureHintOverlayProps): JSX.Element | null;
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* GestureHintOverlay
|
|
408
|
+
*
|
|
409
|
+
* Transient visual feedback for mobile gestures:
|
|
410
|
+
* - Seek forward / backward: animated ripple + text on left / right half
|
|
411
|
+
*/
|
|
412
|
+
declare interface GestureHintOverlayProps {
|
|
413
|
+
type: 'seek-forward' | 'seek-backward' | null;
|
|
414
|
+
value: string;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
export declare interface IntroOutro {
|
|
418
|
+
intro?: {
|
|
419
|
+
start: number;
|
|
420
|
+
end: number;
|
|
421
|
+
};
|
|
422
|
+
outro?: {
|
|
423
|
+
start: number;
|
|
424
|
+
end: number;
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* Type guard for checking if an event type is a valid VideoEventType
|
|
430
|
+
*/
|
|
431
|
+
export declare function isVideoEventType(event: string): event is VideoEventType;
|
|
432
|
+
|
|
433
|
+
export declare function JumpToLiveButton(): JSX.Element | null;
|
|
434
|
+
|
|
435
|
+
export declare function KeyboardShortcutsOverlay({ isOpen, onClose }: KeyboardShortcutsOverlayProps): JSX.Element | null;
|
|
436
|
+
|
|
437
|
+
declare interface KeyboardShortcutsOverlayProps {
|
|
438
|
+
isOpen: boolean;
|
|
439
|
+
onClose: () => void;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
declare interface LicenseAcquisitionConfig {
|
|
443
|
+
timeout?: number;
|
|
444
|
+
maxRetries?: number;
|
|
445
|
+
retryDelay?: number;
|
|
446
|
+
prepareLicenseRequest?: (request: ArrayBuffer) => ArrayBuffer | Promise<ArrayBuffer>;
|
|
447
|
+
parseLicenseResponse?: (response: ArrayBuffer) => ArrayBuffer | Promise<ArrayBuffer>;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
export declare function LiveLatencyDisplay(): JSX.Element | null;
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Media Error Codes
|
|
454
|
+
*
|
|
455
|
+
* Standard HTML5 media error codes for better error handling
|
|
456
|
+
*/
|
|
457
|
+
declare const MediaErrorCode: {
|
|
458
|
+
MEDIA_ERR_ABORTED: number;
|
|
459
|
+
MEDIA_ERR_NETWORK: number;
|
|
460
|
+
MEDIA_ERR_DECODE: number;
|
|
461
|
+
MEDIA_ERR_SRC_NOT_SUPPORTED: number;
|
|
462
|
+
};
|
|
463
|
+
|
|
464
|
+
declare type MediaErrorCode = typeof MediaErrorCode[keyof typeof MediaErrorCode];
|
|
465
|
+
export { MediaErrorCode }
|
|
466
|
+
export { MediaErrorCode as MediaErrorCodeType }
|
|
467
|
+
|
|
468
|
+
export declare function MuteButton({ className, onClick, ...props }: MuteButtonProps): JSX.Element;
|
|
469
|
+
|
|
470
|
+
declare interface MuteButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
export declare interface MuteEvent extends PlayerEvent {
|
|
474
|
+
type: 'mute';
|
|
475
|
+
data: {
|
|
476
|
+
muted: boolean;
|
|
477
|
+
volume: number;
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
export declare interface PauseEvent extends PlayerEvent {
|
|
482
|
+
type: 'pause';
|
|
483
|
+
data: {
|
|
484
|
+
currentTime: number;
|
|
485
|
+
duration: number;
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
export declare function PipButton({ className, onClick, ...props }: PipButtonProps): JSX.Element;
|
|
490
|
+
|
|
491
|
+
declare interface PipButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
export declare function PlaybackSpeedSelector(): JSX.Element;
|
|
495
|
+
|
|
496
|
+
export declare function PlayButton({ className, onClick, iconSize, hoverBackground, pauseIcon, playIcon, style, ...props }: PlayButtonProps): JSX.Element;
|
|
497
|
+
|
|
498
|
+
declare interface PlayButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
499
|
+
/** Icon size in px. Default: 24 */
|
|
500
|
+
iconSize?: number;
|
|
501
|
+
/** Hover background color. Pass false to disable hover background. */
|
|
502
|
+
hoverBackground?: string | boolean;
|
|
503
|
+
/** Custom icon shown when playing (replaces default pause icon). */
|
|
504
|
+
pauseIcon?: React.ReactNode;
|
|
505
|
+
/** Custom icon shown when paused (replaces default play icon). */
|
|
506
|
+
playIcon?: React.ReactNode;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
declare function Player({ src, defaultControls, autoplay, muted, poster, className, children, config, onAdLoading, onNextEpisode, nextEpisodeTitle, nextEpisodeThumbnail, endCardCountdown, crossOrigin, }: PlayerComponentProps): JSX.Element;
|
|
510
|
+
export { Player }
|
|
511
|
+
export default Player;
|
|
512
|
+
|
|
513
|
+
declare interface PlayerComponentProps extends PlayerProps {
|
|
514
|
+
children?: ReactNode;
|
|
515
|
+
config?: PlayerConfig;
|
|
516
|
+
/** Called when next-episode card fires (auto or manual). If omitted the end card is not shown. */
|
|
517
|
+
onNextEpisode?: () => void;
|
|
518
|
+
/** Title of the next episode shown in the end card */
|
|
519
|
+
nextEpisodeTitle?: string;
|
|
520
|
+
/** Thumbnail URL for the next episode */
|
|
521
|
+
nextEpisodeThumbnail?: string;
|
|
522
|
+
/** Seconds to count down before auto-advancing (default 5) */
|
|
523
|
+
endCardCountdown?: number;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
export declare interface PlayerConfig {
|
|
527
|
+
/**
|
|
528
|
+
* Player behavior configuration
|
|
529
|
+
*/
|
|
530
|
+
player?: {
|
|
531
|
+
/** Default volume (0-1) */
|
|
532
|
+
defaultVolume?: number;
|
|
533
|
+
/** Default playback rate */
|
|
534
|
+
defaultPlaybackRate?: number;
|
|
535
|
+
/** Skip forward/backward duration in seconds */
|
|
536
|
+
skipSeconds?: number;
|
|
537
|
+
/** Auto-resume from last position */
|
|
538
|
+
autoResume?: boolean;
|
|
539
|
+
/** Loop video */
|
|
540
|
+
loop?: boolean;
|
|
541
|
+
/** Preload strategy */
|
|
542
|
+
preload?: 'none' | 'metadata' | 'auto';
|
|
543
|
+
/** Include credentials (cookies, auth headers) in CORS requests */
|
|
544
|
+
withCredentials?: boolean;
|
|
545
|
+
};
|
|
546
|
+
/**
|
|
547
|
+
* UI/UX configuration
|
|
548
|
+
*/
|
|
549
|
+
ui?: {
|
|
550
|
+
/** Auto-hide controls delay (ms) */
|
|
551
|
+
autoHideDelay?: number;
|
|
552
|
+
/** Show player title */
|
|
553
|
+
showTitle?: boolean;
|
|
554
|
+
/** Control bar position */
|
|
555
|
+
controlBarPosition?: 'bottom' | 'overlay';
|
|
556
|
+
/** Seek bar height (px) */
|
|
557
|
+
seekBarHeight?: number;
|
|
558
|
+
/** Show time tooltip on hover */
|
|
559
|
+
showTimeTooltip?: boolean;
|
|
560
|
+
/** Show volume slider */
|
|
561
|
+
showVolumeSlider?: boolean;
|
|
562
|
+
/** Show/hide center play, pause and loading overlay icons (default: true) */
|
|
563
|
+
showOverlayIcons?: boolean;
|
|
564
|
+
/** Custom overlay icons */
|
|
565
|
+
overlayIcons?: {
|
|
566
|
+
/** Custom play icon (SVG string or image URL) */
|
|
567
|
+
playIcon?: string;
|
|
568
|
+
/** Custom pause icon (SVG string or image URL) */
|
|
569
|
+
pauseIcon?: string;
|
|
570
|
+
/** Custom loading/buffering icon (SVG string or image URL) */
|
|
571
|
+
loadingIcon?: string;
|
|
572
|
+
/** Icon size (px) */
|
|
573
|
+
iconSize?: number;
|
|
574
|
+
/** Container size (px) */
|
|
575
|
+
containerSize?: number;
|
|
576
|
+
};
|
|
577
|
+
/** Seek bar visual style overrides */
|
|
578
|
+
seekBar?: {
|
|
579
|
+
/** Track (background) color — default: rgba(255,255,255,0.3) */
|
|
580
|
+
trackColor?: string;
|
|
581
|
+
/** Playback progress bar color — default: #6366f1 (VOD) / #ff2020 (live) */
|
|
582
|
+
progressColor?: string;
|
|
583
|
+
/** Buffered range fill color — default: rgba(255,255,255,0.25) */
|
|
584
|
+
bufferedColor?: string;
|
|
585
|
+
/** Seek handle / thumb color — default: #ffffff */
|
|
586
|
+
handleColor?: string;
|
|
587
|
+
/** Track height in px — default: 4 */
|
|
588
|
+
height?: number;
|
|
589
|
+
/** Track border-radius in px — default: 2 */
|
|
590
|
+
borderRadius?: number;
|
|
591
|
+
/** Show the circular thumb/handle on the seek bar (default: true) */
|
|
592
|
+
showHandle?: boolean;
|
|
593
|
+
/** Show the time tooltip on hover (default: true) */
|
|
594
|
+
showTooltip?: boolean;
|
|
595
|
+
/** Horizontal padding of the seekbar container in px — default: 20 */
|
|
596
|
+
paddingX?: number;
|
|
597
|
+
/** Vertical padding of the seekbar container in px — default: 0 */
|
|
598
|
+
paddingY?: number;
|
|
599
|
+
/** Distance from the bottom of the player in px — default: 64 */
|
|
600
|
+
bottom?: number;
|
|
601
|
+
};
|
|
602
|
+
};
|
|
603
|
+
/**
|
|
604
|
+
* Feature toggles
|
|
605
|
+
*/
|
|
606
|
+
features?: {
|
|
607
|
+
/** Enable Picture-in-Picture */
|
|
608
|
+
pip?: boolean;
|
|
609
|
+
/** Enable fullscreen */
|
|
610
|
+
fullscreen?: boolean;
|
|
611
|
+
/** Enable theater mode */
|
|
612
|
+
theaterMode?: boolean;
|
|
613
|
+
/** Enable chapters */
|
|
614
|
+
chapters?: boolean;
|
|
615
|
+
/** Enable skip intro/outro */
|
|
616
|
+
skipIntro?: boolean;
|
|
617
|
+
/** Enable subtitles */
|
|
618
|
+
subtitles?: boolean;
|
|
619
|
+
/** Enable quality selector */
|
|
620
|
+
qualitySelector?: boolean;
|
|
621
|
+
/** Enable audio track selector */
|
|
622
|
+
audioTrackSelector?: boolean;
|
|
623
|
+
/** Enable playback speed control */
|
|
624
|
+
playbackSpeed?: boolean;
|
|
625
|
+
/** Enable keyboard shortcuts */
|
|
626
|
+
keyboardShortcuts?: boolean;
|
|
627
|
+
/** Enable AirPlay button (Safari only — hidden in other browsers) */
|
|
628
|
+
airPlay?: boolean;
|
|
629
|
+
};
|
|
630
|
+
/**
|
|
631
|
+
* Branding and styling
|
|
632
|
+
*/
|
|
633
|
+
branding?: {
|
|
634
|
+
/** Primary color (hex) */
|
|
635
|
+
primaryColor?: string;
|
|
636
|
+
/** Accent color (hex) */
|
|
637
|
+
accentColor?: string;
|
|
638
|
+
/** Player logo URL */
|
|
639
|
+
logo?: string;
|
|
640
|
+
/** Logo link */
|
|
641
|
+
logoLink?: string;
|
|
642
|
+
/** Custom CSS class */
|
|
643
|
+
customClass?: string;
|
|
644
|
+
};
|
|
645
|
+
/**
|
|
646
|
+
* Content metadata
|
|
647
|
+
*/
|
|
648
|
+
metadata?: {
|
|
649
|
+
/** Video title */
|
|
650
|
+
title?: string;
|
|
651
|
+
/** Video description */
|
|
652
|
+
description?: string;
|
|
653
|
+
/** Thumbnail URL */
|
|
654
|
+
thumbnail?: string;
|
|
655
|
+
/** Content rating */
|
|
656
|
+
rating?: string;
|
|
657
|
+
/** Content warnings */
|
|
658
|
+
warnings?: string[];
|
|
659
|
+
};
|
|
660
|
+
/**
|
|
661
|
+
* Advanced settings
|
|
662
|
+
*/
|
|
663
|
+
advanced?: {
|
|
664
|
+
/** Buffer ahead time (seconds) */
|
|
665
|
+
bufferAhead?: number;
|
|
666
|
+
/** Buffer behind time (seconds) */
|
|
667
|
+
bufferBehind?: number;
|
|
668
|
+
/** Max buffer length (seconds) */
|
|
669
|
+
maxBufferLength?: number;
|
|
670
|
+
/** Enable debug mode */
|
|
671
|
+
debug?: boolean;
|
|
672
|
+
/** Analytics enabled */
|
|
673
|
+
analytics?: boolean;
|
|
674
|
+
/** Error reporting enabled */
|
|
675
|
+
errorReporting?: boolean;
|
|
676
|
+
};
|
|
677
|
+
/**
|
|
678
|
+
* Thumbnail preview (storyboard) configuration.
|
|
679
|
+
* Provide a WebVTT file mapping time ranges to image URLs.
|
|
680
|
+
* Supports sprite sheets via #xywh media fragments.
|
|
681
|
+
*/
|
|
682
|
+
thumbnails?: {
|
|
683
|
+
/** URL of the WebVTT thumbnail track */
|
|
684
|
+
vttUrl?: string;
|
|
685
|
+
};
|
|
686
|
+
/**
|
|
687
|
+
* Live stream configuration
|
|
688
|
+
*/
|
|
689
|
+
live?: {
|
|
690
|
+
/**
|
|
691
|
+
* Seconds behind live edge before the player is considered "not at live edge".
|
|
692
|
+
* Used to show/hide the "Jump to Live" button. Default: 10
|
|
693
|
+
*/
|
|
694
|
+
atLiveEdgeTolerance?: number;
|
|
695
|
+
/** Show the "Jump to Live" button when behind the live edge (default: true) */
|
|
696
|
+
showJumpToLiveButton?: boolean;
|
|
697
|
+
/** Show current latency badge next to the live indicator (default: false) */
|
|
698
|
+
showLatency?: boolean;
|
|
699
|
+
/** DVR window: allow seeking back in live streams (default: true when seekable range > 0) */
|
|
700
|
+
dvr?: boolean;
|
|
701
|
+
};
|
|
702
|
+
/**
|
|
703
|
+
* Playron license key.
|
|
704
|
+
* Obtain a key at https://playron.dev/license
|
|
705
|
+
* Without a valid key the player runs in trial mode (watermark shown).
|
|
706
|
+
*/
|
|
707
|
+
licenseKey?: string;
|
|
708
|
+
/**
|
|
709
|
+
* Rich player mode (enables advanced features like timeline markers)
|
|
710
|
+
*/
|
|
711
|
+
isRichPlayer?: boolean;
|
|
712
|
+
/**
|
|
713
|
+
* Timeline markers configuration
|
|
714
|
+
*/
|
|
715
|
+
timeline?: TimelineConfig;
|
|
716
|
+
/**
|
|
717
|
+
* DRM (Digital Rights Management) configuration.
|
|
718
|
+
* Supports Widevine, FairPlay, and PlayReady.
|
|
719
|
+
* All three can be configured simultaneously — the player will select the
|
|
720
|
+
* system supported by the current browser automatically.
|
|
721
|
+
*/
|
|
722
|
+
drm?: {
|
|
723
|
+
/** Enable DRM (default: false) */
|
|
724
|
+
enabled?: boolean;
|
|
725
|
+
/** Widevine — Chrome, Firefox, Android, Smart TVs */
|
|
726
|
+
widevine?: {
|
|
727
|
+
licenseUrl: string;
|
|
728
|
+
/** Extra HTTP headers sent with every license request */
|
|
729
|
+
headers?: Record<string, string>;
|
|
730
|
+
/** Include cookies in license requests */
|
|
731
|
+
withCredentials?: boolean;
|
|
732
|
+
licenseAcquisitionConfig?: LicenseAcquisitionConfig;
|
|
733
|
+
};
|
|
734
|
+
/** FairPlay Streaming — Safari, iOS, macOS */
|
|
735
|
+
fairplay?: {
|
|
736
|
+
licenseUrl: string;
|
|
737
|
+
/** URL of the FairPlay server certificate (.der / .cer) */
|
|
738
|
+
certificateUrl: string;
|
|
739
|
+
headers?: Record<string, string>;
|
|
740
|
+
withCredentials?: boolean;
|
|
741
|
+
licenseAcquisitionConfig?: LicenseAcquisitionConfig;
|
|
742
|
+
};
|
|
743
|
+
/** PlayReady — Edge, IE, Windows, Xbox */
|
|
744
|
+
playready?: {
|
|
745
|
+
licenseUrl: string;
|
|
746
|
+
headers?: Record<string, string>;
|
|
747
|
+
withCredentials?: boolean;
|
|
748
|
+
licenseAcquisitionConfig?: LicenseAcquisitionConfig;
|
|
749
|
+
};
|
|
750
|
+
/**
|
|
751
|
+
* Force a specific DRM system instead of auto-detecting.
|
|
752
|
+
* Useful when testing or when a specific system should take precedence.
|
|
753
|
+
*/
|
|
754
|
+
preferredSystem?: 'widevine' | 'fairplay' | 'playready';
|
|
755
|
+
};
|
|
756
|
+
/**
|
|
757
|
+
* Ads configuration (VAST/VMAP)
|
|
758
|
+
*/
|
|
759
|
+
ads?: {
|
|
760
|
+
/** Enable ads */
|
|
761
|
+
enabled?: boolean;
|
|
762
|
+
/** VAST URL (for pre-roll ad, if vmapUrl is not provided) */
|
|
763
|
+
vastUrl?: string;
|
|
764
|
+
/** VMAP URL (alternative to vastUrl - supports pre-roll, mid-roll, post-roll) */
|
|
765
|
+
vmapUrl?: string;
|
|
766
|
+
/** Skip button after X seconds (default: 5, 0 = no skip) */
|
|
767
|
+
skipAfter?: number;
|
|
768
|
+
/** VAST/VMAP request timeout in ms (default: 5000) */
|
|
769
|
+
timeout?: number;
|
|
770
|
+
/** Max VAST wrapper depth (default: 5) */
|
|
771
|
+
maxWrapperDepth?: number;
|
|
772
|
+
};
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
export declare class PlayerCore {
|
|
776
|
+
private videoEngine;
|
|
777
|
+
private configManager;
|
|
778
|
+
private stateManager;
|
|
779
|
+
private videoElement;
|
|
780
|
+
private container;
|
|
781
|
+
events: PlayronEventEmitter;
|
|
782
|
+
private streamType;
|
|
783
|
+
private streamInfo;
|
|
784
|
+
private hlsEngine;
|
|
785
|
+
private dashEngine;
|
|
786
|
+
private airPlayAvailable;
|
|
787
|
+
private airPlayActive;
|
|
788
|
+
private onAirPlayAvailabilityChanged;
|
|
789
|
+
private onAirPlayTargetChanged;
|
|
790
|
+
private stallDetector;
|
|
791
|
+
private liveLatencyTimer;
|
|
792
|
+
/** Seconds within which the playhead is considered "at live edge" */
|
|
793
|
+
private atLiveEdgeTolerance;
|
|
794
|
+
private drmConfig;
|
|
795
|
+
private drmManager;
|
|
796
|
+
private castManager;
|
|
797
|
+
constructor(videoElement: HTMLVideoElement);
|
|
798
|
+
/**
|
|
799
|
+
* PlayerCore'u başlat
|
|
800
|
+
*/
|
|
801
|
+
private initialize;
|
|
802
|
+
/**
|
|
803
|
+
* State değişikliklerini dinle
|
|
804
|
+
*/
|
|
805
|
+
private setupStateListeners;
|
|
806
|
+
/**
|
|
807
|
+
* Konfigürasyon ile PlayerCore'u başlat
|
|
808
|
+
*/
|
|
809
|
+
static createWithConfig(config: VanillaPlayerConfig): PlayerCore;
|
|
810
|
+
/**
|
|
811
|
+
* DRM konfigürasyonunu ayarla. setSource() çağrısından ÖNCE çağrılmalı.
|
|
812
|
+
* Widevine (Chrome/Firefox) ve PlayReady (Edge) desteklenir.
|
|
813
|
+
*/
|
|
814
|
+
setupDrm(config: PlayerConfig['drm']): void;
|
|
815
|
+
/**
|
|
816
|
+
* Video'yu oynat
|
|
817
|
+
*/
|
|
818
|
+
play(): Promise<void>;
|
|
819
|
+
/**
|
|
820
|
+
* Video'yu duraklat
|
|
821
|
+
*/
|
|
822
|
+
pause(): void;
|
|
823
|
+
/**
|
|
824
|
+
* Video'yu sessize al/aç
|
|
825
|
+
*/
|
|
826
|
+
toggleMute(): void;
|
|
827
|
+
/**
|
|
828
|
+
* Ses seviyesini ayarla
|
|
829
|
+
*/
|
|
830
|
+
setVolume(volume: number): void;
|
|
831
|
+
/**
|
|
832
|
+
* Buffered time ranges from the video element.
|
|
833
|
+
*/
|
|
834
|
+
getBufferedRanges(): Array<{
|
|
835
|
+
start: number;
|
|
836
|
+
end: number;
|
|
837
|
+
}>;
|
|
838
|
+
/**
|
|
839
|
+
* Real-time playback statistics (Stats for Nerds).
|
|
840
|
+
*/
|
|
841
|
+
getPlayerStats(): {
|
|
842
|
+
bandwidth: number;
|
|
843
|
+
bufferHealth: number;
|
|
844
|
+
droppedFrames: number;
|
|
845
|
+
totalFrames: number;
|
|
846
|
+
codec: string;
|
|
847
|
+
resolution: string;
|
|
848
|
+
segmentUrl: string;
|
|
849
|
+
streamType: string;
|
|
850
|
+
};
|
|
851
|
+
private persistVolume;
|
|
852
|
+
private loadPersistedVolume;
|
|
853
|
+
/**
|
|
854
|
+
* Belirli bir zamana git
|
|
855
|
+
*/
|
|
856
|
+
seekTo(time: number): void;
|
|
857
|
+
/**
|
|
858
|
+
* Oynatma hızını ayarla
|
|
859
|
+
*/
|
|
860
|
+
setPlaybackRate(rate: number): void;
|
|
861
|
+
/**
|
|
862
|
+
* Video source'unu değiştir.
|
|
863
|
+
* HLS (.m3u8) → HlsEngine (hls.js)
|
|
864
|
+
* DASH (.mpd) → Faz 2'de dash.js
|
|
865
|
+
* Diğerleri → native <video>
|
|
866
|
+
*/
|
|
867
|
+
setSource(src: string): Promise<void>;
|
|
868
|
+
/**
|
|
869
|
+
* Aktif streaming engine'i temizle
|
|
870
|
+
*/
|
|
871
|
+
private destroyStreamingEngines;
|
|
872
|
+
/**
|
|
873
|
+
* Native video element fallback
|
|
874
|
+
*/
|
|
875
|
+
private fallbackToNative;
|
|
876
|
+
getStreamType(): StreamType;
|
|
877
|
+
getStreamInfo(): StreamInfo | null;
|
|
878
|
+
isLive(): boolean;
|
|
879
|
+
getLiveEdgeTime(): number;
|
|
880
|
+
getCurrentLatency(): number;
|
|
881
|
+
isAtLiveEdge(tolerance?: number): boolean;
|
|
882
|
+
seekToLiveEdge(): void;
|
|
883
|
+
getDVRRange(): {
|
|
884
|
+
start: number;
|
|
885
|
+
end: number;
|
|
886
|
+
} | null;
|
|
887
|
+
private startLiveLatencyTracking;
|
|
888
|
+
private stopLiveLatencyTracking;
|
|
889
|
+
private startStallDetector;
|
|
890
|
+
setPoster(poster: string): void;
|
|
891
|
+
setDimensions(width: number | string, height: number | string): void;
|
|
892
|
+
getState(): PlayerState | null;
|
|
893
|
+
getVideoEngine(): VideoEngine | null;
|
|
894
|
+
getConfigManager(): ConfigManager | null;
|
|
895
|
+
getStateManager(): StateManager | null;
|
|
896
|
+
getVideoElement(): HTMLVideoElement | null;
|
|
897
|
+
toggleFullscreen(): void;
|
|
898
|
+
togglePip(): Promise<void>;
|
|
899
|
+
skipBackward(seconds?: number): void;
|
|
900
|
+
skipForward(seconds?: number): void;
|
|
901
|
+
setLoop(loop: boolean): void;
|
|
902
|
+
getLoop(): boolean;
|
|
903
|
+
/**
|
|
904
|
+
* Kalite değiştir. 'auto' → ABR, diğerleri → level index.
|
|
905
|
+
*/
|
|
906
|
+
setQuality(qualityId: string): void;
|
|
907
|
+
getQuality(): QualityLevel | null;
|
|
908
|
+
getAvailableQualities(): QualityLevel[];
|
|
909
|
+
/**
|
|
910
|
+
* Ses izini değiştir (dublaj seçimi).
|
|
911
|
+
*/
|
|
912
|
+
setAudioTrack(trackId: string): void;
|
|
913
|
+
getAudioTrack(): string;
|
|
914
|
+
getAvailableAudioTracks(): Array<{
|
|
915
|
+
id: string;
|
|
916
|
+
label: string;
|
|
917
|
+
language: string;
|
|
918
|
+
}>;
|
|
919
|
+
getSubtitleTracks(): Array<{
|
|
920
|
+
language: string;
|
|
921
|
+
label: string;
|
|
922
|
+
url: string;
|
|
923
|
+
}>;
|
|
924
|
+
setSubtitleTrack(language: string | null): Promise<void>;
|
|
925
|
+
getActiveSubtitleLanguage(): string | null;
|
|
926
|
+
private setupAirPlay;
|
|
927
|
+
showAirPlayPicker(): void;
|
|
928
|
+
isAirPlayAvailable(): boolean;
|
|
929
|
+
isAirPlayActive(): boolean;
|
|
930
|
+
private destroyAirPlay;
|
|
931
|
+
/**
|
|
932
|
+
* Load the Google Cast SDK and set up the Cast context.
|
|
933
|
+
* Call once — idempotent. Cast device picker becomes available after this.
|
|
934
|
+
*
|
|
935
|
+
* @param appId Cast receiver app ID (defaults to DEFAULT_MEDIA_RECEIVER_APP_ID)
|
|
936
|
+
*/
|
|
937
|
+
setupChromecast(appId?: string): void;
|
|
938
|
+
/** Open the Chromecast device picker. */
|
|
939
|
+
showCastPicker(): Promise<void>;
|
|
940
|
+
/** Stop casting and end the session. */
|
|
941
|
+
stopCasting(): void;
|
|
942
|
+
/** Returns true when at least one Cast device is nearby. */
|
|
943
|
+
isCastAvailable(): boolean;
|
|
944
|
+
/** Returns true when a Cast session is currently active. */
|
|
945
|
+
isCastActive(): boolean;
|
|
946
|
+
private destroyChromecast;
|
|
947
|
+
toggleTheaterMode(): void;
|
|
948
|
+
isTheaterMode(): boolean;
|
|
949
|
+
/**
|
|
950
|
+
* PlayerCore'u tamamen temizle.
|
|
951
|
+
*/
|
|
952
|
+
destroy(): void;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
export declare interface PlayerEvent {
|
|
956
|
+
type: string;
|
|
957
|
+
data?: any;
|
|
958
|
+
timestamp: number;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
declare interface PlayerMethods {
|
|
962
|
+
play: () => Promise<void>;
|
|
963
|
+
pause: () => void;
|
|
964
|
+
togglePlay: () => Promise<void>;
|
|
965
|
+
toggleMute: () => void;
|
|
966
|
+
setVolume: (volume: number) => void;
|
|
967
|
+
seekTo: (time: number) => void;
|
|
968
|
+
setPlaybackRate: (rate: number) => void;
|
|
969
|
+
toggleFullscreen: () => void;
|
|
970
|
+
togglePip: () => Promise<void>;
|
|
971
|
+
skipBackward: (seconds?: number) => void;
|
|
972
|
+
skipForward: (seconds?: number) => void;
|
|
973
|
+
setLoop: (loop: boolean) => void;
|
|
974
|
+
getLoop: () => boolean;
|
|
975
|
+
setQuality: (quality: string) => void;
|
|
976
|
+
getQuality: () => QualityLevel | null;
|
|
977
|
+
getAvailableQualities: () => QualityLevel[];
|
|
978
|
+
setAudioTrack: (trackId: string) => void;
|
|
979
|
+
getAudioTrack: () => string;
|
|
980
|
+
getAvailableAudioTracks: () => Array<{
|
|
981
|
+
id: string;
|
|
982
|
+
label: string;
|
|
983
|
+
language: string;
|
|
984
|
+
}>;
|
|
985
|
+
toggleTheaterMode: () => void;
|
|
986
|
+
isTheaterMode: () => boolean;
|
|
987
|
+
getPlayer: () => any;
|
|
988
|
+
onNextEpisode?: () => void;
|
|
989
|
+
getStreamType: () => 'vod' | 'live' | 'unknown';
|
|
990
|
+
getStreamInfo: () => any;
|
|
991
|
+
isLive: () => boolean;
|
|
992
|
+
getBufferedRanges: () => Array<{
|
|
993
|
+
start: number;
|
|
994
|
+
end: number;
|
|
995
|
+
}>;
|
|
996
|
+
seekToLiveEdge: () => void;
|
|
997
|
+
getCurrentLatency: () => number;
|
|
998
|
+
isAtLiveEdge: (tolerance?: number) => boolean;
|
|
999
|
+
getDVRRange: () => {
|
|
1000
|
+
start: number;
|
|
1001
|
+
end: number;
|
|
1002
|
+
} | null;
|
|
1003
|
+
getSubtitleTracks: () => Array<{
|
|
1004
|
+
language: string;
|
|
1005
|
+
label: string;
|
|
1006
|
+
url: string;
|
|
1007
|
+
}>;
|
|
1008
|
+
setSubtitleTrack: (language: string | null) => Promise<void>;
|
|
1009
|
+
getActiveSubtitleLanguage: () => string | null;
|
|
1010
|
+
getPlayerStats: () => {
|
|
1011
|
+
bandwidth: number;
|
|
1012
|
+
bufferHealth: number;
|
|
1013
|
+
droppedFrames: number;
|
|
1014
|
+
totalFrames: number;
|
|
1015
|
+
codec: string;
|
|
1016
|
+
resolution: string;
|
|
1017
|
+
segmentUrl: string;
|
|
1018
|
+
streamType: string;
|
|
1019
|
+
};
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
declare type PlayerMode = 'vod' | 'live';
|
|
1023
|
+
|
|
1024
|
+
export declare interface PlayerProps {
|
|
1025
|
+
src?: string;
|
|
1026
|
+
width?: string | number;
|
|
1027
|
+
height?: string | number;
|
|
1028
|
+
defaultControls?: boolean;
|
|
1029
|
+
autoplay?: boolean;
|
|
1030
|
+
muted?: boolean;
|
|
1031
|
+
poster?: string;
|
|
1032
|
+
className?: string;
|
|
1033
|
+
onAdLoading?: (isLoading: boolean) => void;
|
|
1034
|
+
/**
|
|
1035
|
+
* Sets the crossOrigin attribute on the underlying <video> element.
|
|
1036
|
+
* Default: undefined (no crossOrigin attribute).
|
|
1037
|
+
* Set to 'anonymous' only if your video CDN sends proper CORS headers
|
|
1038
|
+
* AND you need canvas/screenshot access. On iOS, setting this without
|
|
1039
|
+
* proper CORS headers will break playback.
|
|
1040
|
+
*/
|
|
1041
|
+
crossOrigin?: 'anonymous' | 'use-credentials';
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
export declare function PlayerProvider({ children, playerInstance }: PlayerProviderProps): JSX.Element;
|
|
1045
|
+
|
|
1046
|
+
declare interface PlayerProviderProps {
|
|
1047
|
+
children: ReactNode;
|
|
1048
|
+
playerInstance: PlayerCore | null;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
export declare interface PlayerState {
|
|
1052
|
+
isPlaying: boolean;
|
|
1053
|
+
isMuted: boolean;
|
|
1054
|
+
volume: number;
|
|
1055
|
+
currentTime: number;
|
|
1056
|
+
duration: number;
|
|
1057
|
+
playbackRate?: number;
|
|
1058
|
+
isLive?: boolean;
|
|
1059
|
+
isAtLiveEdge?: boolean;
|
|
1060
|
+
liveLatency?: number;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
export declare interface PlayEvent extends PlayerEvent {
|
|
1064
|
+
type: 'play';
|
|
1065
|
+
data: {
|
|
1066
|
+
currentTime: number;
|
|
1067
|
+
duration: number;
|
|
1068
|
+
};
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
export declare class Playron {
|
|
1072
|
+
private playerCore;
|
|
1073
|
+
private videoElement;
|
|
1074
|
+
private container;
|
|
1075
|
+
constructor(videoElementOrConfig: HTMLVideoElement | VanillaPlayerConfig);
|
|
1076
|
+
/**
|
|
1077
|
+
* Mevcut video element ile başlat
|
|
1078
|
+
*/
|
|
1079
|
+
private initWithElement;
|
|
1080
|
+
/**
|
|
1081
|
+
* Konfigürasyon ile kendi player'ı oluştur
|
|
1082
|
+
*/
|
|
1083
|
+
private initWithConfig;
|
|
1084
|
+
on<T extends AllPlayerEvents>(eventType: T['type'], callback: EventCallback<T>): void;
|
|
1085
|
+
off<T extends AllPlayerEvents>(eventType: T['type'], callback: EventCallback<T>): void;
|
|
1086
|
+
play(): Promise<void>;
|
|
1087
|
+
pause(): void;
|
|
1088
|
+
toggleMute(): void;
|
|
1089
|
+
setVolume(volume: number): void;
|
|
1090
|
+
getState(): PlayerState | null;
|
|
1091
|
+
/**
|
|
1092
|
+
* Video source'u değiştir (auto-detects stream type)
|
|
1093
|
+
*/
|
|
1094
|
+
setSource(src: string): Promise<void>;
|
|
1095
|
+
/**
|
|
1096
|
+
* Belirli bir zamana git
|
|
1097
|
+
*/
|
|
1098
|
+
seekTo(time: number): void;
|
|
1099
|
+
/**
|
|
1100
|
+
* Oynatma hızını ayarla
|
|
1101
|
+
*/
|
|
1102
|
+
setPlaybackRate(rate: number): void;
|
|
1103
|
+
/**
|
|
1104
|
+
* Video poster'ını ayarla
|
|
1105
|
+
*/
|
|
1106
|
+
setPoster(poster: string): void;
|
|
1107
|
+
/**
|
|
1108
|
+
* Video boyutlarını ayarla
|
|
1109
|
+
*/
|
|
1110
|
+
setDimensions(width: number | string, height: number | string): void;
|
|
1111
|
+
/**
|
|
1112
|
+
* Player'ı temizle
|
|
1113
|
+
*/
|
|
1114
|
+
destroy(): void;
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
/**
|
|
1118
|
+
* Unified event emitter for Playron
|
|
1119
|
+
*/
|
|
1120
|
+
export declare class PlayronEventEmitter {
|
|
1121
|
+
private listeners;
|
|
1122
|
+
private onceListeners;
|
|
1123
|
+
/**
|
|
1124
|
+
* Subscribe to an event
|
|
1125
|
+
*/
|
|
1126
|
+
on<T extends VirtusEventType>(event: T, callback: VirtusEventCallback<T>): void;
|
|
1127
|
+
/**
|
|
1128
|
+
* Subscribe to an event (fires only once)
|
|
1129
|
+
*/
|
|
1130
|
+
once<T extends VirtusEventType>(event: T, callback: VirtusEventCallback<T>): void;
|
|
1131
|
+
/**
|
|
1132
|
+
* Unsubscribe from an event
|
|
1133
|
+
*/
|
|
1134
|
+
off<T extends VirtusEventType>(event: T, callback: VirtusEventCallback<T>): void;
|
|
1135
|
+
/**
|
|
1136
|
+
* Emit an event
|
|
1137
|
+
*/
|
|
1138
|
+
emit<T extends VirtusEventType>(event: T, data: VirtusEventMap[T]): void;
|
|
1139
|
+
/**
|
|
1140
|
+
* Remove all listeners for a specific event or all events
|
|
1141
|
+
*/
|
|
1142
|
+
removeAllListeners(event?: VirtusEventType): void;
|
|
1143
|
+
/**
|
|
1144
|
+
* Get listener count for an event
|
|
1145
|
+
*/
|
|
1146
|
+
listenerCount(event: VirtusEventType): number;
|
|
1147
|
+
/**
|
|
1148
|
+
* Get all registered event types
|
|
1149
|
+
*/
|
|
1150
|
+
eventNames(): VirtusEventType[];
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
/**
|
|
1154
|
+
* Quality level (bitrate/resolution)
|
|
1155
|
+
*/
|
|
1156
|
+
declare interface QualityLevel {
|
|
1157
|
+
id: string;
|
|
1158
|
+
label: string;
|
|
1159
|
+
width: number;
|
|
1160
|
+
height: number;
|
|
1161
|
+
bandwidth: number;
|
|
1162
|
+
codecs: string;
|
|
1163
|
+
frameRate?: number;
|
|
1164
|
+
uri: string;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
export declare function SeekBar({ mode, chapters, timelineEvents, showTimelineMarkers, markerSize, thumbnailsVttUrl, seekBarStyle, }: SeekBarProps): JSX.Element;
|
|
1168
|
+
|
|
1169
|
+
export declare const SeekBarContainer: FunctionComponent<SeekBarContainerProps>;
|
|
1170
|
+
|
|
1171
|
+
declare interface SeekBarContainerProps {
|
|
1172
|
+
mode?: PlayerMode;
|
|
1173
|
+
chapters?: Chapter[];
|
|
1174
|
+
timelineEvents?: TimelineEvent[];
|
|
1175
|
+
showTimelineMarkers?: boolean;
|
|
1176
|
+
markerSize?: number;
|
|
1177
|
+
config?: PlayerConfig;
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
declare interface SeekBarProps {
|
|
1181
|
+
mode?: PlayerMode;
|
|
1182
|
+
chapters?: Chapter[];
|
|
1183
|
+
timelineEvents?: TimelineEvent[];
|
|
1184
|
+
showTimelineMarkers?: boolean;
|
|
1185
|
+
markerSize?: number;
|
|
1186
|
+
/** WebVTT storyboard URL for hover thumbnail preview */
|
|
1187
|
+
thumbnailsVttUrl?: string;
|
|
1188
|
+
/** Custom seek bar visual style */
|
|
1189
|
+
seekBarStyle?: SeekBarStyle;
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
declare interface SeekBarStyle {
|
|
1193
|
+
/** Track (background) color */
|
|
1194
|
+
trackColor?: string;
|
|
1195
|
+
/** Playback progress bar color (overrides the default VOD/live color) */
|
|
1196
|
+
progressColor?: string;
|
|
1197
|
+
/** Buffered range fill color */
|
|
1198
|
+
bufferedColor?: string;
|
|
1199
|
+
/** Seek handle / thumb color */
|
|
1200
|
+
handleColor?: string;
|
|
1201
|
+
/** Track height in px */
|
|
1202
|
+
height?: number;
|
|
1203
|
+
/** Track border-radius in px */
|
|
1204
|
+
borderRadius?: number;
|
|
1205
|
+
/** Show circular thumb/handle */
|
|
1206
|
+
showHandle?: boolean;
|
|
1207
|
+
/** Show time tooltip on hover */
|
|
1208
|
+
showTooltip?: boolean;
|
|
1209
|
+
/** Horizontal padding of the seekbar container in px (default: 20) */
|
|
1210
|
+
paddingX?: number;
|
|
1211
|
+
/** Vertical padding of the seekbar container in px (default: 0) */
|
|
1212
|
+
paddingY?: number;
|
|
1213
|
+
/** Distance from the bottom of the player in px (default: 64) */
|
|
1214
|
+
bottom?: number;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
export declare function SettingsButton(): JSX.Element;
|
|
1218
|
+
|
|
1219
|
+
export declare function SettingsPanel({ theme, panelPosition, iconSize, hoverBackground, gearIcon, }?: {
|
|
1220
|
+
theme?: SettingsPanelTheme;
|
|
1221
|
+
panelPosition?: SettingsPanelPosition;
|
|
1222
|
+
/** Gear icon size in px. Default: 20 */
|
|
1223
|
+
iconSize?: number;
|
|
1224
|
+
/** Hover background color for the gear button. Pass false to disable hover background. */
|
|
1225
|
+
hoverBackground?: string | boolean;
|
|
1226
|
+
/** Custom icon replacing the default gear SVG. */
|
|
1227
|
+
gearIcon?: React.ReactNode;
|
|
1228
|
+
}): JSX.Element;
|
|
1229
|
+
|
|
1230
|
+
/** Where the panel opens relative to the gear button. */
|
|
1231
|
+
export declare interface SettingsPanelPosition {
|
|
1232
|
+
/** 'top' = panel opens above the button (default). 'bottom' = opens below. */
|
|
1233
|
+
vertical?: 'top' | 'bottom';
|
|
1234
|
+
/** 'right' = right-aligned (default). 'left' = left-aligned. */
|
|
1235
|
+
horizontal?: 'left' | 'right';
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
/**
|
|
1239
|
+
* SettingsPanel
|
|
1240
|
+
*
|
|
1241
|
+
* YouTube / Netflix-style unified settings panel.
|
|
1242
|
+
* A single ⚙️ gear button opens a multi-level panel:
|
|
1243
|
+
*
|
|
1244
|
+
* Root:
|
|
1245
|
+
* Quality → Auto / 1080p / 720p …
|
|
1246
|
+
* Speed → 0.25× … 2×
|
|
1247
|
+
* Audio → English / Türkçe … (hidden when no tracks)
|
|
1248
|
+
* Subtitles→ Off / EN / TR … (always shown)
|
|
1249
|
+
*
|
|
1250
|
+
* Each row navigates to a submenu. Back arrow returns to root.
|
|
1251
|
+
* Selecting an item applies the change and closes the panel.
|
|
1252
|
+
*/
|
|
1253
|
+
/** Customize the visual appearance of the SettingsPanel. */
|
|
1254
|
+
export declare interface SettingsPanelTheme {
|
|
1255
|
+
/** Panel background. Default: 'rgba(12, 12, 20, 0.97)' */
|
|
1256
|
+
background?: string;
|
|
1257
|
+
/** Panel border color. Default: 'rgba(255,255,255,0.1)' */
|
|
1258
|
+
borderColor?: string;
|
|
1259
|
+
/** Main text color. Default: '#fff' */
|
|
1260
|
+
textColor?: string;
|
|
1261
|
+
/**
|
|
1262
|
+
* Accent/highlight color for selected items (hex preferred).
|
|
1263
|
+
* Default: '#6366f1'
|
|
1264
|
+
*/
|
|
1265
|
+
accentColor?: string;
|
|
1266
|
+
/** Row font size. Default: '13.5px' */
|
|
1267
|
+
fontSize?: string;
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
export declare function SkipBackwardButton({ seconds, iconSize, hoverBackground, icon, }: SkipBackwardButtonProps): JSX.Element | null;
|
|
1271
|
+
|
|
1272
|
+
declare interface SkipBackwardButtonProps {
|
|
1273
|
+
seconds?: number;
|
|
1274
|
+
/** Icon size in px. Default: 24 */
|
|
1275
|
+
iconSize?: number;
|
|
1276
|
+
/** Hover background color. Pass false to disable hover background. */
|
|
1277
|
+
hoverBackground?: string | boolean;
|
|
1278
|
+
/** Custom icon (replaces default skip backward SVG). */
|
|
1279
|
+
icon?: React.ReactNode;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
export declare function SkipForwardButton({ seconds, iconSize, hoverBackground, icon, }: SkipForwardButtonProps): JSX.Element | null;
|
|
1283
|
+
|
|
1284
|
+
declare interface SkipForwardButtonProps {
|
|
1285
|
+
seconds?: number;
|
|
1286
|
+
/** Icon size in px. Default: 24 */
|
|
1287
|
+
iconSize?: number;
|
|
1288
|
+
/** Hover background color. Pass false to disable hover background. */
|
|
1289
|
+
hoverBackground?: string | boolean;
|
|
1290
|
+
/** Custom icon (replaces default skip forward SVG). */
|
|
1291
|
+
icon?: React.ReactNode;
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
export declare function SkipIntroButton({ introOutro }: SkipIntroButtonProps): JSX.Element | null;
|
|
1295
|
+
|
|
1296
|
+
declare interface SkipIntroButtonProps {
|
|
1297
|
+
introOutro?: IntroOutro;
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
export declare class StallDetector {
|
|
1301
|
+
private video;
|
|
1302
|
+
private events;
|
|
1303
|
+
private options;
|
|
1304
|
+
private timer;
|
|
1305
|
+
private lastTime;
|
|
1306
|
+
private stallDuration;
|
|
1307
|
+
private attempts;
|
|
1308
|
+
private isRunning;
|
|
1309
|
+
constructor(video: HTMLVideoElement, events: PlayronEventEmitter, options?: StallDetectorOptions);
|
|
1310
|
+
start(): void;
|
|
1311
|
+
stop(): void;
|
|
1312
|
+
destroy(): void;
|
|
1313
|
+
private reset;
|
|
1314
|
+
private tick;
|
|
1315
|
+
private recover;
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
export declare interface StallDetectorOptions {
|
|
1319
|
+
/** Poll interval in ms (default: 500) */
|
|
1320
|
+
pollInterval?: number;
|
|
1321
|
+
/** Seconds of no-progress before first recovery attempt (default: 3) */
|
|
1322
|
+
stallThreshold?: number;
|
|
1323
|
+
/** Called when quality downgrade is needed (attempt 3) */
|
|
1324
|
+
onQualityDowngrade?: () => void;
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
declare class StateManager {
|
|
1328
|
+
private state;
|
|
1329
|
+
private listeners;
|
|
1330
|
+
private history;
|
|
1331
|
+
private maxHistorySize;
|
|
1332
|
+
constructor(initialState?: Partial<PlayerState>);
|
|
1333
|
+
/**
|
|
1334
|
+
* Başlangıç durumunu oluştur
|
|
1335
|
+
*/
|
|
1336
|
+
private getInitialState;
|
|
1337
|
+
/**
|
|
1338
|
+
* Durumu güncelle
|
|
1339
|
+
*/
|
|
1340
|
+
updateState(updates: Partial<PlayerState>): void;
|
|
1341
|
+
/**
|
|
1342
|
+
* Mevcut durumu döndür
|
|
1343
|
+
*/
|
|
1344
|
+
getState(): PlayerState;
|
|
1345
|
+
/**
|
|
1346
|
+
* Belirli bir durum değerini al
|
|
1347
|
+
*/
|
|
1348
|
+
get<K extends keyof PlayerState>(key: K): PlayerState[K];
|
|
1349
|
+
/**
|
|
1350
|
+
* Belirli bir durum değerini ayarla
|
|
1351
|
+
*/
|
|
1352
|
+
set<K extends keyof PlayerState>(key: K, value: PlayerState[K]): void;
|
|
1353
|
+
/**
|
|
1354
|
+
* Durum değişiklik dinleyicisi ekle
|
|
1355
|
+
*/
|
|
1356
|
+
subscribe(callback: (state: PlayerState) => void): void;
|
|
1357
|
+
/**
|
|
1358
|
+
* Durum değişiklik dinleyicisini kaldır
|
|
1359
|
+
*/
|
|
1360
|
+
unsubscribe(callback: (state: PlayerState) => void): void;
|
|
1361
|
+
/**
|
|
1362
|
+
* Durum değişikliklerini bildir
|
|
1363
|
+
*/
|
|
1364
|
+
private notifyListeners;
|
|
1365
|
+
/**
|
|
1366
|
+
* Durumu geçmişe ekle
|
|
1367
|
+
*/
|
|
1368
|
+
private addToHistory;
|
|
1369
|
+
/**
|
|
1370
|
+
* Önceki duruma geri dön
|
|
1371
|
+
*/
|
|
1372
|
+
undo(): boolean;
|
|
1373
|
+
/**
|
|
1374
|
+
* Durumu sıfırla
|
|
1375
|
+
*/
|
|
1376
|
+
reset(): void;
|
|
1377
|
+
/**
|
|
1378
|
+
* Durumu belirli bir değere ayarla
|
|
1379
|
+
*/
|
|
1380
|
+
setState(newState: PlayerState): void;
|
|
1381
|
+
/**
|
|
1382
|
+
* Durum geçmişini temizle
|
|
1383
|
+
*/
|
|
1384
|
+
clearHistory(): void;
|
|
1385
|
+
/**
|
|
1386
|
+
* Durum geçmişini döndür
|
|
1387
|
+
*/
|
|
1388
|
+
getHistory(): PlayerState[];
|
|
1389
|
+
/**
|
|
1390
|
+
* Belirli bir durumda olup olmadığını kontrol et
|
|
1391
|
+
*/
|
|
1392
|
+
isInState(predicate: (state: PlayerState) => boolean): boolean;
|
|
1393
|
+
/**
|
|
1394
|
+
* Durum değişikliklerini filtrele
|
|
1395
|
+
*/
|
|
1396
|
+
subscribeToChanges<K extends keyof PlayerState>(keys: K[], callback: (changes: Pick<PlayerState, K>) => void): void;
|
|
1397
|
+
/**
|
|
1398
|
+
* Durumu snapshot olarak al
|
|
1399
|
+
*/
|
|
1400
|
+
createSnapshot(): PlayerState;
|
|
1401
|
+
/**
|
|
1402
|
+
* Snapshot'tan durumu geri yükle
|
|
1403
|
+
*/
|
|
1404
|
+
restoreFromSnapshot(snapshot: PlayerState): void;
|
|
1405
|
+
/**
|
|
1406
|
+
* Durum istatistiklerini döndür
|
|
1407
|
+
*/
|
|
1408
|
+
getStats(): {
|
|
1409
|
+
totalListeners: number;
|
|
1410
|
+
historySize: number;
|
|
1411
|
+
maxHistorySize: number;
|
|
1412
|
+
lastUpdate: Date;
|
|
1413
|
+
};
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
export declare class StreamDetector {
|
|
1417
|
+
/**
|
|
1418
|
+
* Main detection method
|
|
1419
|
+
* Fetches and analyzes manifest to determine stream type
|
|
1420
|
+
*/
|
|
1421
|
+
detectStream(url: string): Promise<StreamInfo>;
|
|
1422
|
+
/**
|
|
1423
|
+
* Pre-check basic browser capability using MediaSource.isTypeSupported
|
|
1424
|
+
* to quickly determine if we should fall back to an external library.
|
|
1425
|
+
*/
|
|
1426
|
+
private preCheckCapability;
|
|
1427
|
+
/**
|
|
1428
|
+
* Detect protocol from URL
|
|
1429
|
+
*/
|
|
1430
|
+
private detectProtocol;
|
|
1431
|
+
/**
|
|
1432
|
+
* Detect HLS stream type
|
|
1433
|
+
*/
|
|
1434
|
+
private detectHLS;
|
|
1435
|
+
/**
|
|
1436
|
+
* Detect DASH stream type
|
|
1437
|
+
*/
|
|
1438
|
+
private detectDASH;
|
|
1439
|
+
/**
|
|
1440
|
+
* Progressive download (MP4, WebM, etc.)
|
|
1441
|
+
* Always VOD
|
|
1442
|
+
*/
|
|
1443
|
+
private detectProgressive;
|
|
1444
|
+
/**
|
|
1445
|
+
* Fetch manifest from URL
|
|
1446
|
+
*/
|
|
1447
|
+
private fetchManifest;
|
|
1448
|
+
/**
|
|
1449
|
+
* Extract #EXT-X-TARGETDURATION
|
|
1450
|
+
*/
|
|
1451
|
+
private extractTargetDuration;
|
|
1452
|
+
/**
|
|
1453
|
+
* Extract #EXT-X-MEDIA-SEQUENCE
|
|
1454
|
+
*/
|
|
1455
|
+
private extractMediaSequence;
|
|
1456
|
+
/**
|
|
1457
|
+
* Quick sync detection (without fetching)
|
|
1458
|
+
* Useful for initial UI setup
|
|
1459
|
+
*/
|
|
1460
|
+
quickDetect(url: string): {
|
|
1461
|
+
type: StreamType;
|
|
1462
|
+
protocol: 'hls' | 'dash' | 'progressive' | 'unknown';
|
|
1463
|
+
isEngineSupported: boolean;
|
|
1464
|
+
};
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
/**
|
|
1468
|
+
* Singleton instance
|
|
1469
|
+
*/
|
|
1470
|
+
export declare const streamDetector: StreamDetector;
|
|
1471
|
+
|
|
1472
|
+
export declare interface StreamInfo {
|
|
1473
|
+
type: StreamType;
|
|
1474
|
+
protocol: 'hls' | 'dash' | 'progressive' | 'unknown';
|
|
1475
|
+
isDynamic: boolean;
|
|
1476
|
+
hasDVR: boolean;
|
|
1477
|
+
targetDuration?: number;
|
|
1478
|
+
mediaSequence?: number;
|
|
1479
|
+
/**
|
|
1480
|
+
* Pre-check capability.
|
|
1481
|
+
* True if basic codecs (avc1/mp4a) are supported, preventing full playback engine load if not.
|
|
1482
|
+
*/
|
|
1483
|
+
isEngineSupported: boolean;
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
/**
|
|
1487
|
+
* Stream Type Detector
|
|
1488
|
+
* Automatically detects if a stream is VOD or LIVE by analyzing the manifest
|
|
1489
|
+
*/
|
|
1490
|
+
export declare type StreamType = 'vod' | 'live' | 'unknown';
|
|
1491
|
+
|
|
1492
|
+
export declare function TheaterModeButton(): JSX.Element;
|
|
1493
|
+
|
|
1494
|
+
/**
|
|
1495
|
+
* ThumbnailManager — WebVTT storyboard thumbnail loader.
|
|
1496
|
+
*
|
|
1497
|
+
* Accepts a thumbnail VTT URL where each cue maps a time range to
|
|
1498
|
+
* an image URL (optionally with a #xywh media fragment for sprite sheets).
|
|
1499
|
+
*
|
|
1500
|
+
* VTT format example:
|
|
1501
|
+
* WEBVTT
|
|
1502
|
+
*
|
|
1503
|
+
* 00:00:00.000 --> 00:00:05.000
|
|
1504
|
+
* https://cdn.example.com/thumbs.jpg#xywh=0,0,160,90
|
|
1505
|
+
*
|
|
1506
|
+
* 00:00:05.000 --> 00:00:10.000
|
|
1507
|
+
* https://cdn.example.com/thumbs.jpg#xywh=160,0,160,90
|
|
1508
|
+
*/
|
|
1509
|
+
export declare interface ThumbnailCue {
|
|
1510
|
+
startTime: number;
|
|
1511
|
+
endTime: number;
|
|
1512
|
+
/** Full image URL (without fragment) */
|
|
1513
|
+
url: string;
|
|
1514
|
+
/** Sprite x offset (0 when whole image) */
|
|
1515
|
+
x: number;
|
|
1516
|
+
/** Sprite y offset (0 when whole image) */
|
|
1517
|
+
y: number;
|
|
1518
|
+
/** Sprite/image width (0 = full image width) */
|
|
1519
|
+
w: number;
|
|
1520
|
+
/** Sprite/image height (0 = full image height) */
|
|
1521
|
+
h: number;
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
export declare class ThumbnailManager {
|
|
1525
|
+
private cues;
|
|
1526
|
+
private loaded;
|
|
1527
|
+
/** Fetch and parse a WebVTT thumbnail track. */
|
|
1528
|
+
load(vttUrl: string): Promise<void>;
|
|
1529
|
+
/** Return the thumbnail cue covering the given time, or null. */
|
|
1530
|
+
getThumbnailAt(time: number): ThumbnailCue | null;
|
|
1531
|
+
isLoaded(): boolean;
|
|
1532
|
+
destroy(): void;
|
|
1533
|
+
private parseVtt;
|
|
1534
|
+
private parseCueLine;
|
|
1535
|
+
private resolveUrl;
|
|
1536
|
+
private parseTime;
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
export declare function TimeDisplay({ className, ...props }: TimeDisplayProps): JSX.Element;
|
|
1540
|
+
|
|
1541
|
+
declare interface TimeDisplayProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
/**
|
|
1545
|
+
* Timeline Marker Configuration
|
|
1546
|
+
*/
|
|
1547
|
+
declare interface TimelineConfig {
|
|
1548
|
+
/** Enable timeline markers */
|
|
1549
|
+
enabled?: boolean;
|
|
1550
|
+
/** Timeline events */
|
|
1551
|
+
events?: TimelineEvent[];
|
|
1552
|
+
/** Marker size in px */
|
|
1553
|
+
markerSize?: number;
|
|
1554
|
+
/** Show tooltip on hover */
|
|
1555
|
+
showTooltip?: boolean;
|
|
1556
|
+
/** Auto-parse from raw event data (e.g., sports API) */
|
|
1557
|
+
parser?: (rawEvents: any[]) => TimelineEvent[];
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
/**
|
|
1561
|
+
* Timeline Marker Types
|
|
1562
|
+
* For rich video players with interactive event markers (sports, live events, etc.)
|
|
1563
|
+
*/
|
|
1564
|
+
export declare interface TimelineEvent {
|
|
1565
|
+
/** Event timestamp in seconds */
|
|
1566
|
+
time: number;
|
|
1567
|
+
/** Event type (goal, yellow, red, substitution, kickoff, etc.) */
|
|
1568
|
+
type: string;
|
|
1569
|
+
/** Optional custom icon (emoji or SVG) */
|
|
1570
|
+
icon?: string;
|
|
1571
|
+
/** Optional custom color */
|
|
1572
|
+
color?: string;
|
|
1573
|
+
/** Label for tooltip */
|
|
1574
|
+
label?: string;
|
|
1575
|
+
/** Any additional metadata */
|
|
1576
|
+
metadata?: Record<string, any>;
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
export declare function useMobileGestures({ player, skipSec }: UseMobileGesturesOptions): {
|
|
1580
|
+
onTouchStart: (e: React.TouchEvent<HTMLDivElement>) => void;
|
|
1581
|
+
onTouchMove: (_e: React.TouchEvent<HTMLDivElement>) => void;
|
|
1582
|
+
onTouchEnd: () => void;
|
|
1583
|
+
gestureHint: GestureHint | null;
|
|
1584
|
+
};
|
|
1585
|
+
|
|
1586
|
+
declare interface UseMobileGesturesOptions {
|
|
1587
|
+
player: PlayerCore | null;
|
|
1588
|
+
skipSec?: number;
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
/**
|
|
1592
|
+
* Get player instance
|
|
1593
|
+
* Use this when you need access to the full PlayerCore instance
|
|
1594
|
+
*/
|
|
1595
|
+
export declare function usePlayer(): PlayerCore;
|
|
1596
|
+
|
|
1597
|
+
/**
|
|
1598
|
+
* Get player methods (stable reference, won't cause re-renders)
|
|
1599
|
+
* Use this when you only need to call player methods
|
|
1600
|
+
*/
|
|
1601
|
+
export declare function usePlayerMethods(): PlayerMethods;
|
|
1602
|
+
|
|
1603
|
+
/**
|
|
1604
|
+
* Get player state (reactive)
|
|
1605
|
+
* Component will re-render when state changes
|
|
1606
|
+
*
|
|
1607
|
+
* @param selector - Optional selector to get only specific state values
|
|
1608
|
+
* @returns Player state or selected value
|
|
1609
|
+
*/
|
|
1610
|
+
export declare function usePlayerState(): PlayerState;
|
|
1611
|
+
|
|
1612
|
+
export declare function usePlayerState<T>(selector: (state: PlayerState) => T): T;
|
|
1613
|
+
|
|
1614
|
+
export declare interface VanillaPlayerConfig {
|
|
1615
|
+
container: string | HTMLElement;
|
|
1616
|
+
src: string;
|
|
1617
|
+
width?: string | number;
|
|
1618
|
+
height?: string | number;
|
|
1619
|
+
autoplay?: boolean;
|
|
1620
|
+
muted?: boolean;
|
|
1621
|
+
poster?: string;
|
|
1622
|
+
className?: string;
|
|
1623
|
+
controls?: boolean;
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
declare class VideoEngine {
|
|
1627
|
+
private videoElement;
|
|
1628
|
+
private isPlaying;
|
|
1629
|
+
private isMuted;
|
|
1630
|
+
private volume;
|
|
1631
|
+
private playbackRate;
|
|
1632
|
+
private currentTime;
|
|
1633
|
+
private duration;
|
|
1634
|
+
constructor(videoElement: HTMLVideoElement);
|
|
1635
|
+
/**
|
|
1636
|
+
* Video element'inin native event'lerini dinle
|
|
1637
|
+
*/
|
|
1638
|
+
private setupEventListeners;
|
|
1639
|
+
/**
|
|
1640
|
+
* Video'yu başlat
|
|
1641
|
+
*/
|
|
1642
|
+
private initializeVideo;
|
|
1643
|
+
/**
|
|
1644
|
+
* Play event'ini gönder
|
|
1645
|
+
*/
|
|
1646
|
+
private emitPlayEvent;
|
|
1647
|
+
/**
|
|
1648
|
+
* Pause event'ini gönder
|
|
1649
|
+
*/
|
|
1650
|
+
private emitPauseEvent;
|
|
1651
|
+
/**
|
|
1652
|
+
* Volume change event'ini gönder
|
|
1653
|
+
*/
|
|
1654
|
+
private emitVolumeChangeEvent;
|
|
1655
|
+
/**
|
|
1656
|
+
* Mute event'ini gönder
|
|
1657
|
+
*/
|
|
1658
|
+
private emitMuteEvent;
|
|
1659
|
+
/**
|
|
1660
|
+
* Video'yu oynat
|
|
1661
|
+
*/
|
|
1662
|
+
play(): Promise<void>;
|
|
1663
|
+
/**
|
|
1664
|
+
* Video'yu duraklat
|
|
1665
|
+
*/
|
|
1666
|
+
pause(): void;
|
|
1667
|
+
/**
|
|
1668
|
+
* Video'yu sessize al/aç
|
|
1669
|
+
*/
|
|
1670
|
+
toggleMute(): void;
|
|
1671
|
+
/**
|
|
1672
|
+
* Ses seviyesini ayarla
|
|
1673
|
+
*/
|
|
1674
|
+
setVolume(volume: number): void;
|
|
1675
|
+
/**
|
|
1676
|
+
* Belirli bir zamana git
|
|
1677
|
+
*/
|
|
1678
|
+
seekTo(time: number): void;
|
|
1679
|
+
/**
|
|
1680
|
+
* Oynatma hızını ayarla
|
|
1681
|
+
*/
|
|
1682
|
+
setPlaybackRate(rate: number): void;
|
|
1683
|
+
/**
|
|
1684
|
+
* Video source'unu değiştir
|
|
1685
|
+
*/
|
|
1686
|
+
setSource(src: string): void;
|
|
1687
|
+
/**
|
|
1688
|
+
* Video poster'ını ayarla
|
|
1689
|
+
*/
|
|
1690
|
+
setPoster(poster: string): void;
|
|
1691
|
+
/**
|
|
1692
|
+
* Video boyutlarını ayarla
|
|
1693
|
+
*/
|
|
1694
|
+
setDimensions(width: number | string, height: number | string): void;
|
|
1695
|
+
/**
|
|
1696
|
+
* Mevcut durumu döndür
|
|
1697
|
+
*/
|
|
1698
|
+
getState(): {
|
|
1699
|
+
isPlaying: boolean;
|
|
1700
|
+
isMuted: boolean;
|
|
1701
|
+
volume: number;
|
|
1702
|
+
playbackRate: number;
|
|
1703
|
+
currentTime: number;
|
|
1704
|
+
duration: number;
|
|
1705
|
+
src: string;
|
|
1706
|
+
poster: string;
|
|
1707
|
+
};
|
|
1708
|
+
/**
|
|
1709
|
+
* Video element'ini döndür
|
|
1710
|
+
*/
|
|
1711
|
+
getVideoElement(): HTMLVideoElement | null;
|
|
1712
|
+
/**
|
|
1713
|
+
* VideoEngine'ı temizle
|
|
1714
|
+
*/
|
|
1715
|
+
destroy(): void;
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
/**
|
|
1719
|
+
* Native HTML5 Video Element Event Types
|
|
1720
|
+
*
|
|
1721
|
+
* This enum provides type-safe access to all native video events.
|
|
1722
|
+
* Using these constants prevents typos and improves maintainability.
|
|
1723
|
+
*
|
|
1724
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#events
|
|
1725
|
+
*/
|
|
1726
|
+
declare const VideoEventType: {
|
|
1727
|
+
readonly PLAY: "play";
|
|
1728
|
+
readonly PAUSE: "pause";
|
|
1729
|
+
readonly PLAYING: "playing";
|
|
1730
|
+
readonly ENDED: "ended";
|
|
1731
|
+
readonly SEEKING: "seeking";
|
|
1732
|
+
readonly SEEKED: "seeked";
|
|
1733
|
+
readonly WAITING: "waiting";
|
|
1734
|
+
readonly VOLUME_CHANGE: "volumechange";
|
|
1735
|
+
readonly TIME_UPDATE: "timeupdate";
|
|
1736
|
+
readonly DURATION_CHANGE: "durationchange";
|
|
1737
|
+
readonly LOADED_METADATA: "loadedmetadata";
|
|
1738
|
+
readonly LOADED_DATA: "loadeddata";
|
|
1739
|
+
readonly CAN_PLAY: "canplay";
|
|
1740
|
+
readonly CAN_PLAY_THROUGH: "canplaythrough";
|
|
1741
|
+
readonly RATE_CHANGE: "ratechange";
|
|
1742
|
+
readonly LOAD_START: "loadstart";
|
|
1743
|
+
readonly PROGRESS: "progress";
|
|
1744
|
+
readonly SUSPEND: "suspend";
|
|
1745
|
+
readonly ABORT: "abort";
|
|
1746
|
+
readonly STALLED: "stalled";
|
|
1747
|
+
readonly ERROR: "error";
|
|
1748
|
+
readonly EMPTIED: "emptied";
|
|
1749
|
+
readonly RESIZE: "resize";
|
|
1750
|
+
};
|
|
1751
|
+
|
|
1752
|
+
declare type VideoEventType = typeof VideoEventType[keyof typeof VideoEventType];
|
|
1753
|
+
export { VideoEventType }
|
|
1754
|
+
export { VideoEventType as VideoEventTypeType }
|
|
1755
|
+
|
|
1756
|
+
declare type VirtusEventCallback<T extends VirtusEventType> = (data: VirtusEventMap[T]) => void;
|
|
1757
|
+
|
|
1758
|
+
/**
|
|
1759
|
+
* PlayronEventEmitter - Unified event system for player
|
|
1760
|
+
* Provides type-safe, consistent event handling across the player
|
|
1761
|
+
*/
|
|
1762
|
+
export declare type VirtusEventMap = {
|
|
1763
|
+
'play': {
|
|
1764
|
+
timestamp: number;
|
|
1765
|
+
};
|
|
1766
|
+
'pause': {
|
|
1767
|
+
timestamp: number;
|
|
1768
|
+
};
|
|
1769
|
+
'ended': {
|
|
1770
|
+
timestamp: number;
|
|
1771
|
+
};
|
|
1772
|
+
'timeupdate': {
|
|
1773
|
+
currentTime: number;
|
|
1774
|
+
duration: number;
|
|
1775
|
+
};
|
|
1776
|
+
'seeking': {
|
|
1777
|
+
targetTime: number;
|
|
1778
|
+
};
|
|
1779
|
+
'seeked': {
|
|
1780
|
+
currentTime: number;
|
|
1781
|
+
};
|
|
1782
|
+
'volumechange': {
|
|
1783
|
+
volume: number;
|
|
1784
|
+
isMuted: boolean;
|
|
1785
|
+
};
|
|
1786
|
+
'ratechange': {
|
|
1787
|
+
playbackRate: number;
|
|
1788
|
+
};
|
|
1789
|
+
'loadedmetadata': {
|
|
1790
|
+
duration: number;
|
|
1791
|
+
videoWidth: number;
|
|
1792
|
+
videoHeight: number;
|
|
1793
|
+
};
|
|
1794
|
+
'buffering': {
|
|
1795
|
+
isBuffering: boolean;
|
|
1796
|
+
};
|
|
1797
|
+
'qualitychange': {
|
|
1798
|
+
from: string;
|
|
1799
|
+
to: string;
|
|
1800
|
+
};
|
|
1801
|
+
'audiotrackchange': {
|
|
1802
|
+
from: string;
|
|
1803
|
+
to: string;
|
|
1804
|
+
};
|
|
1805
|
+
'fullscreenchange': {
|
|
1806
|
+
isFullscreen: boolean;
|
|
1807
|
+
};
|
|
1808
|
+
'pipchange': {
|
|
1809
|
+
isPip: boolean;
|
|
1810
|
+
};
|
|
1811
|
+
'theatermodechange': {
|
|
1812
|
+
isTheaterMode: boolean;
|
|
1813
|
+
};
|
|
1814
|
+
'chapterchange': {
|
|
1815
|
+
chapterId: string;
|
|
1816
|
+
title: string;
|
|
1817
|
+
};
|
|
1818
|
+
'skipintro': {
|
|
1819
|
+
skipped: boolean;
|
|
1820
|
+
time: number;
|
|
1821
|
+
};
|
|
1822
|
+
'skipoutro': {
|
|
1823
|
+
skipped: boolean;
|
|
1824
|
+
time: number;
|
|
1825
|
+
};
|
|
1826
|
+
'streamTypeDetected': {
|
|
1827
|
+
type: 'vod' | 'live' | 'unknown';
|
|
1828
|
+
info: any;
|
|
1829
|
+
};
|
|
1830
|
+
/** Fired immediately after manifest is parsed and tracks/qualities are populated. */
|
|
1831
|
+
'tracksready': {
|
|
1832
|
+
hasQualities: boolean;
|
|
1833
|
+
hasAudioTracks: boolean;
|
|
1834
|
+
hasSubtitleTracks: boolean;
|
|
1835
|
+
};
|
|
1836
|
+
/** Fires when AirPlay device availability or connection state changes */
|
|
1837
|
+
'airplaychange': {
|
|
1838
|
+
isAvailable: boolean;
|
|
1839
|
+
isActive: boolean;
|
|
1840
|
+
};
|
|
1841
|
+
/** Fires when Chromecast device availability or session state changes */
|
|
1842
|
+
'castchange': {
|
|
1843
|
+
isAvailable: boolean;
|
|
1844
|
+
isActive: boolean;
|
|
1845
|
+
state: 'not_connected' | 'connecting' | 'connected' | 'unavailable';
|
|
1846
|
+
};
|
|
1847
|
+
/** Periodic latency update — only emitted during live playback (~1s interval) */
|
|
1848
|
+
'livelatencyupdate': {
|
|
1849
|
+
latency: number;
|
|
1850
|
+
isAtLiveEdge: boolean;
|
|
1851
|
+
liveEdgeTime: number;
|
|
1852
|
+
};
|
|
1853
|
+
'drm:keysystem': {
|
|
1854
|
+
keySystem: string;
|
|
1855
|
+
};
|
|
1856
|
+
'drm:ready': {
|
|
1857
|
+
keySystem?: string;
|
|
1858
|
+
};
|
|
1859
|
+
/** Emitted when playback freezes (currentTime stops advancing) */
|
|
1860
|
+
'stall': {
|
|
1861
|
+
duration: number;
|
|
1862
|
+
attempt: number;
|
|
1863
|
+
};
|
|
1864
|
+
/** Emitted when a stall is resolved by the recovery mechanism */
|
|
1865
|
+
'stallrecovered': {
|
|
1866
|
+
duration: number;
|
|
1867
|
+
method: 'seek' | 'quality';
|
|
1868
|
+
};
|
|
1869
|
+
'error': {
|
|
1870
|
+
code: string;
|
|
1871
|
+
message: string;
|
|
1872
|
+
details?: any;
|
|
1873
|
+
};
|
|
1874
|
+
'warning': {
|
|
1875
|
+
code: string;
|
|
1876
|
+
message: string;
|
|
1877
|
+
};
|
|
1878
|
+
'statechange': {
|
|
1879
|
+
state: any;
|
|
1880
|
+
};
|
|
1881
|
+
'ready': {
|
|
1882
|
+
player: any;
|
|
1883
|
+
};
|
|
1884
|
+
'destroy': {
|
|
1885
|
+
timestamp: number;
|
|
1886
|
+
};
|
|
1887
|
+
};
|
|
1888
|
+
|
|
1889
|
+
export declare type VirtusEventType = keyof VirtusEventMap;
|
|
1890
|
+
|
|
1891
|
+
export declare interface VolumeChangeEvent extends PlayerEvent {
|
|
1892
|
+
type: 'volumechange';
|
|
1893
|
+
data: {
|
|
1894
|
+
volume: number;
|
|
1895
|
+
muted: boolean;
|
|
1896
|
+
};
|
|
1897
|
+
}
|
|
1898
|
+
|
|
1899
|
+
export declare function VolumeControl({ sliderDirection, theme, iconSize, hoverBackground }: VolumeControlProps): JSX.Element;
|
|
1900
|
+
|
|
1901
|
+
declare interface VolumeControlProps {
|
|
1902
|
+
/** Direction the volume slider expands from the mute button. Default: 'right' */
|
|
1903
|
+
sliderDirection?: VolumeSliderDirection;
|
|
1904
|
+
/** Visual theme overrides. */
|
|
1905
|
+
theme?: VolumeControlTheme;
|
|
1906
|
+
/** Mute button icon size in px. Default: 20 */
|
|
1907
|
+
iconSize?: number;
|
|
1908
|
+
/** Hover background color for the mute button. Pass false to disable. */
|
|
1909
|
+
hoverBackground?: string | boolean;
|
|
1910
|
+
}
|
|
1911
|
+
|
|
1912
|
+
/** Customize the visual appearance of the VolumeControl. */
|
|
1913
|
+
export declare interface VolumeControlTheme {
|
|
1914
|
+
/** Slider popup panel background. Default: 'rgba(10, 10, 20, 0.88)' */
|
|
1915
|
+
sliderBackground?: string;
|
|
1916
|
+
/** Panel border color. Default: 'rgba(255,255,255,0.1)' */
|
|
1917
|
+
borderColor?: string;
|
|
1918
|
+
/** Mute button background. Default: 'rgba(255,255,255,0.1)' */
|
|
1919
|
+
buttonBackground?: string;
|
|
1920
|
+
/** Mute button hover background. Default: 'rgba(255,255,255,0.2)' */
|
|
1921
|
+
buttonHoverBackground?: string;
|
|
1922
|
+
/** Icon / SVG fill color. Default: '#fff' */
|
|
1923
|
+
iconColor?: string;
|
|
1924
|
+
/** Track (unfilled portion) color. Default: 'rgba(255,255,255,0.3)' */
|
|
1925
|
+
trackColor?: string;
|
|
1926
|
+
/** Fill (volume level) color. Default: '#3b82f6' */
|
|
1927
|
+
fillColor?: string;
|
|
1928
|
+
/** Knob handle color. Default: '#fff' */
|
|
1929
|
+
handleColor?: string;
|
|
1930
|
+
}
|
|
1931
|
+
|
|
1932
|
+
export declare type VolumeSliderDirection = 'right' | 'left' | 'top' | 'bottom';
|
|
1933
|
+
|
|
1934
|
+
export { }
|