unified-video-framework 1.4.235 → 1.4.236
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/package.json +1 -1
- package/packages/core/dist/interfaces/IVideoPlayer.d.ts +25 -0
- package/packages/core/dist/interfaces/IVideoPlayer.d.ts.map +1 -1
- package/packages/core/dist/interfaces.d.ts +11 -0
- package/packages/core/dist/interfaces.d.ts.map +1 -1
- package/packages/core/src/interfaces/IVideoPlayer.ts +25 -0
- package/packages/core/src/interfaces.ts +9 -0
- package/packages/web/dist/WebPlayer.d.ts +8 -0
- package/packages/web/dist/WebPlayer.d.ts.map +1 -1
- package/packages/web/dist/WebPlayer.js +210 -30
- package/packages/web/dist/WebPlayer.js.map +1 -1
- package/packages/web/dist/react/WebPlayerView.d.ts +22 -0
- package/packages/web/dist/react/WebPlayerView.d.ts.map +1 -1
- package/packages/web/dist/react/WebPlayerView.js +11 -0
- package/packages/web/dist/react/WebPlayerView.js.map +1 -1
- package/packages/web/src/WebPlayer.ts +279 -35
- package/packages/web/src/react/WebPlayerView.tsx +28 -1
|
@@ -137,7 +137,16 @@ export type WebPlayerViewProps = {
|
|
|
137
137
|
|
|
138
138
|
// Framework branding control
|
|
139
139
|
showFrameworkBranding?: boolean;
|
|
140
|
-
|
|
140
|
+
|
|
141
|
+
// Share configuration
|
|
142
|
+
share?: {
|
|
143
|
+
enabled?: boolean; // Enable/disable share button (default: true)
|
|
144
|
+
url?: string; // Custom share URL (default: window.location.href)
|
|
145
|
+
title?: string; // Custom share title (default: video metadata title)
|
|
146
|
+
text?: string; // Custom share description (default: video metadata description)
|
|
147
|
+
generateUrl?: (videoData: { videoId?: string; metadata?: any }) => string; // Dynamic URL generator
|
|
148
|
+
};
|
|
149
|
+
|
|
141
150
|
// Watermark configuration (can be boolean for simple enable/disable or object for full config)
|
|
142
151
|
watermark?: boolean | {
|
|
143
152
|
enabled?: boolean;
|
|
@@ -201,6 +210,13 @@ export type WebPlayerViewProps = {
|
|
|
201
210
|
subtitles?: SubtitleTrack[];
|
|
202
211
|
metadata?: VideoMetadata;
|
|
203
212
|
|
|
213
|
+
// Fallback configuration
|
|
214
|
+
fallbackSources?: Array<{ url: string; type?: 'mp4' | 'hls' | 'dash' | 'webm' | 'auto'; priority?: number }>;
|
|
215
|
+
fallbackPoster?: string; // Static image to show when all video sources fail
|
|
216
|
+
fallbackRetryDelay?: number; // Delay in ms before trying next fallback (default: 1000)
|
|
217
|
+
fallbackRetryAttempts?: number; // Number of retry attempts per source (default: 1)
|
|
218
|
+
onAllSourcesFailed?: (errors: Array<{ url: string; error: any }>) => void; // Callback when all sources fail
|
|
219
|
+
|
|
204
220
|
// Optional Google Cast sender SDK loader
|
|
205
221
|
cast?: boolean;
|
|
206
222
|
|
|
@@ -838,6 +854,7 @@ export const WebPlayerView: React.FC<WebPlayerViewProps> = (props) => {
|
|
|
838
854
|
settings: props.settings,
|
|
839
855
|
showFrameworkBranding: props.showFrameworkBranding,
|
|
840
856
|
watermark: watermarkConfig,
|
|
857
|
+
share: props.share, // Add share configuration
|
|
841
858
|
qualityFilter: props.qualityFilter, // Add quality filter to config
|
|
842
859
|
premiumQualities: props.premiumQualities, // Add premium qualities config
|
|
843
860
|
// Navigation configuration
|
|
@@ -879,6 +896,11 @@ export const WebPlayerView: React.FC<WebPlayerViewProps> = (props) => {
|
|
|
879
896
|
type: props.type ?? 'auto',
|
|
880
897
|
subtitles: props.subtitles,
|
|
881
898
|
metadata: props.metadata,
|
|
899
|
+
fallbackSources: props.fallbackSources,
|
|
900
|
+
fallbackPoster: props.fallbackPoster,
|
|
901
|
+
fallbackRetryDelay: props.fallbackRetryDelay,
|
|
902
|
+
fallbackRetryAttempts: props.fallbackRetryAttempts,
|
|
903
|
+
onAllSourcesFailed: props.onAllSourcesFailed,
|
|
882
904
|
};
|
|
883
905
|
|
|
884
906
|
await player.load(source);
|
|
@@ -1186,10 +1208,15 @@ export const WebPlayerView: React.FC<WebPlayerViewProps> = (props) => {
|
|
|
1186
1208
|
JSON.stringify(props.settings),
|
|
1187
1209
|
props.showFrameworkBranding,
|
|
1188
1210
|
JSON.stringify(props.watermark),
|
|
1211
|
+
JSON.stringify(props.share),
|
|
1189
1212
|
JSON.stringify(props.navigation),
|
|
1190
1213
|
JSON.stringify(props.googleAds),
|
|
1191
1214
|
JSON.stringify(props.qualityFilter),
|
|
1192
1215
|
JSON.stringify(props.premiumQualities),
|
|
1216
|
+
JSON.stringify(props.fallbackSources),
|
|
1217
|
+
props.fallbackPoster,
|
|
1218
|
+
props.fallbackRetryDelay,
|
|
1219
|
+
props.fallbackRetryAttempts,
|
|
1193
1220
|
]);
|
|
1194
1221
|
|
|
1195
1222
|
// Helper function to filter quality levels based on qualityFilter prop
|