unified-video-framework 1.4.242 → 1.4.244
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unified-video-framework",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.244",
|
|
4
4
|
"description": "Cross-platform video player framework supporting iOS, Android, Web, Smart TVs (Samsung/LG), Roku, and more",
|
|
5
5
|
"main": "packages/core/dist/index.js",
|
|
6
6
|
"types": "packages/core/dist/index.d.ts",
|
|
@@ -106,8 +106,19 @@ export declare class WebPlayer extends BasePlayer {
|
|
|
106
106
|
private updateDASHQuality;
|
|
107
107
|
private loadNative;
|
|
108
108
|
private loadYouTube;
|
|
109
|
-
private
|
|
110
|
-
private
|
|
109
|
+
private youtubePlayer;
|
|
110
|
+
private youtubePlayerReady;
|
|
111
|
+
private youtubeIframe;
|
|
112
|
+
private createYouTubePlayer;
|
|
113
|
+
private loadYouTubeAPI;
|
|
114
|
+
private waitForYouTubeAPI;
|
|
115
|
+
private onYouTubePlayerReady;
|
|
116
|
+
private onYouTubePlayerStateChange;
|
|
117
|
+
private updateYouTubeUI;
|
|
118
|
+
private onYouTubePlayerError;
|
|
119
|
+
private youtubeTimeTrackingInterval;
|
|
120
|
+
private startYouTubeTimeTracking;
|
|
121
|
+
private updateYouTubeProgressBar;
|
|
111
122
|
protected loadScript(src: string): Promise<void>;
|
|
112
123
|
private loadSubtitles;
|
|
113
124
|
private isAbortPlayError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebPlayer.d.ts","sourceRoot":"","sources":["../src/WebPlayer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAOL,OAAO,EACP,cAAc,EACf,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,aAAa,EACb,aAAa,EACb,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AAO,CAAC,eAAe;IAOvB,OAAO,CAAC,eAAe;IAuBvB,OAAO,CAAC,eAAe;IAevB,OAAO,CAAC,iBAAiB;IA0DzB,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,qBAAqB;IA2C7B,OAAO,CAAC,gBAAgB;IA0CxB,OAAO,CAAC,gBAAgB;IAQxB,OAAO,CAAC,YAAY;IA6BpB,OAAO,CAAC,sBAAsB;IA6B9B,OAAO,CAAC,sBAAsB;IAiF9B,OAAO,CAAC,uBAAuB;IAuB/B,OAAO,CAAC,4BAA4B;IAoDpC,OAAO,CAAC,oBAAoB;IA+BrB,aAAa,IAAI,IAAI;IAarB,aAAa,IAAI,IAAI;IAYrB,UAAU,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI;IAe9B,kBAAkB,IAAI,OAAO;YAKtB,OAAO;IAgBf,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAqD/B"}
|
|
@@ -90,6 +90,10 @@ export class WebPlayer extends BasePlayer {
|
|
|
90
90
|
this.lastFailedUrl = '';
|
|
91
91
|
this.isFallbackPosterMode = false;
|
|
92
92
|
this.autoplayAttempted = false;
|
|
93
|
+
this.youtubePlayer = null;
|
|
94
|
+
this.youtubePlayerReady = false;
|
|
95
|
+
this.youtubeIframe = null;
|
|
96
|
+
this.youtubeTimeTrackingInterval = null;
|
|
93
97
|
this.clickToUnmuteHandler = null;
|
|
94
98
|
}
|
|
95
99
|
debugLog(message, ...args) {
|
|
@@ -845,8 +849,7 @@ export class WebPlayer extends BasePlayer {
|
|
|
845
849
|
if (this.video && metadata.thumbnail) {
|
|
846
850
|
this.video.poster = metadata.thumbnail;
|
|
847
851
|
}
|
|
848
|
-
|
|
849
|
-
await this.loadYouTubeIframe(videoId, embedUrl);
|
|
852
|
+
await this.createYouTubePlayer(videoId);
|
|
850
853
|
this.debugLog('✅ YouTube video loaded successfully');
|
|
851
854
|
}
|
|
852
855
|
catch (error) {
|
|
@@ -854,72 +857,219 @@ export class WebPlayer extends BasePlayer {
|
|
|
854
857
|
throw new Error(`YouTube video loading failed: ${error}`);
|
|
855
858
|
}
|
|
856
859
|
}
|
|
857
|
-
async
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
const proxyUrl = `https://www.youtube.com/watch?v=${videoId}`;
|
|
862
|
-
try {
|
|
863
|
-
const response = await fetch(`https://cors-anywhere.herokuapp.com/${proxyUrl}`, {
|
|
864
|
-
method: 'GET',
|
|
865
|
-
headers: {
|
|
866
|
-
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)'
|
|
867
|
-
}
|
|
868
|
-
});
|
|
869
|
-
if (response.ok) {
|
|
870
|
-
const html = await response.text();
|
|
871
|
-
const match = html.match(/"streamingData"\s*:\s*\{([^}]*"url"[^}]*)/);
|
|
872
|
-
if (match) {
|
|
873
|
-
this.debugLog('✅ Found HLS stream in YouTube page');
|
|
874
|
-
}
|
|
875
|
-
}
|
|
876
|
-
}
|
|
877
|
-
catch (proxyError) {
|
|
878
|
-
this.debugWarn('CORS proxy attempt failed, trying fallback:', proxyError);
|
|
879
|
-
}
|
|
880
|
-
this.video.src = '';
|
|
881
|
-
this.video.innerHTML = `
|
|
882
|
-
<source
|
|
883
|
-
src="https://www.youtube.com/embed/${videoId}?fs=1"
|
|
884
|
-
type="text/html"
|
|
885
|
-
/>
|
|
886
|
-
`;
|
|
887
|
-
this.createYouTubeIframeProxy(videoId);
|
|
860
|
+
async createYouTubePlayer(videoId) {
|
|
861
|
+
const container = this.playerWrapper || this.video?.parentElement;
|
|
862
|
+
if (!container) {
|
|
863
|
+
throw new Error('No container found for YouTube player');
|
|
888
864
|
}
|
|
889
|
-
|
|
890
|
-
this.
|
|
891
|
-
if (this.video) {
|
|
892
|
-
throw new Error('YouTube embedding requires either: 1) Backend service to extract streams, or 2) YouTube API key configuration. ' +
|
|
893
|
-
'See documentation for setup instructions.');
|
|
894
|
-
}
|
|
865
|
+
if (this.video) {
|
|
866
|
+
this.video.style.display = 'none';
|
|
895
867
|
}
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
if (!container)
|
|
900
|
-
return;
|
|
901
|
-
const iframe = document.createElement('iframe');
|
|
902
|
-
iframe.id = `youtube-iframe-${videoId}`;
|
|
903
|
-
iframe.style.cssText = `
|
|
868
|
+
const iframeContainer = document.createElement('div');
|
|
869
|
+
iframeContainer.id = `youtube-player-${videoId}`;
|
|
870
|
+
iframeContainer.style.cssText = `
|
|
904
871
|
position: absolute;
|
|
905
872
|
top: 0;
|
|
906
873
|
left: 0;
|
|
907
874
|
width: 100%;
|
|
908
875
|
height: 100%;
|
|
909
|
-
border: none;
|
|
910
876
|
z-index: 1;
|
|
911
|
-
opacity: 0;
|
|
912
|
-
pointer-events: none;
|
|
913
877
|
`;
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
878
|
+
const existingPlayer = container.querySelector(`#youtube-player-${videoId}`);
|
|
879
|
+
if (existingPlayer) {
|
|
880
|
+
existingPlayer.remove();
|
|
881
|
+
}
|
|
882
|
+
container.appendChild(iframeContainer);
|
|
917
883
|
if (!window.YT) {
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
884
|
+
await this.loadYouTubeAPI();
|
|
885
|
+
}
|
|
886
|
+
await this.waitForYouTubeAPI();
|
|
887
|
+
this.youtubePlayer = new window.YT.Player(iframeContainer.id, {
|
|
888
|
+
videoId: videoId,
|
|
889
|
+
width: '100%',
|
|
890
|
+
height: '100%',
|
|
891
|
+
playerVars: {
|
|
892
|
+
controls: 0,
|
|
893
|
+
disablekb: 1,
|
|
894
|
+
fs: 0,
|
|
895
|
+
iv_load_policy: 3,
|
|
896
|
+
modestbranding: 1,
|
|
897
|
+
rel: 0,
|
|
898
|
+
showinfo: 0,
|
|
899
|
+
autoplay: this.config.autoPlay ? 1 : 0,
|
|
900
|
+
mute: this.config.muted ? 1 : 0
|
|
901
|
+
},
|
|
902
|
+
events: {
|
|
903
|
+
onReady: () => this.onYouTubePlayerReady(),
|
|
904
|
+
onStateChange: (event) => this.onYouTubePlayerStateChange(event),
|
|
905
|
+
onError: (event) => this.onYouTubePlayerError(event)
|
|
906
|
+
}
|
|
907
|
+
});
|
|
908
|
+
this.debugLog('YouTube player created');
|
|
909
|
+
}
|
|
910
|
+
async loadYouTubeAPI() {
|
|
911
|
+
return new Promise((resolve) => {
|
|
912
|
+
if (window.YT) {
|
|
913
|
+
resolve();
|
|
914
|
+
return;
|
|
915
|
+
}
|
|
916
|
+
window.onYouTubeIframeAPIReady = () => {
|
|
917
|
+
this.debugLog('YouTube IFrame API loaded');
|
|
918
|
+
resolve();
|
|
919
|
+
};
|
|
920
|
+
const script = document.createElement('script');
|
|
921
|
+
script.src = 'https://www.youtube.com/iframe_api';
|
|
922
|
+
script.async = true;
|
|
923
|
+
document.body.appendChild(script);
|
|
924
|
+
});
|
|
925
|
+
}
|
|
926
|
+
async waitForYouTubeAPI() {
|
|
927
|
+
return new Promise((resolve) => {
|
|
928
|
+
const checkAPI = () => {
|
|
929
|
+
if (window.YT && window.YT.Player) {
|
|
930
|
+
resolve();
|
|
931
|
+
}
|
|
932
|
+
else {
|
|
933
|
+
setTimeout(checkAPI, 100);
|
|
934
|
+
}
|
|
935
|
+
};
|
|
936
|
+
checkAPI();
|
|
937
|
+
});
|
|
938
|
+
}
|
|
939
|
+
onYouTubePlayerReady() {
|
|
940
|
+
this.youtubePlayerReady = true;
|
|
941
|
+
this.debugLog('YouTube player ready');
|
|
942
|
+
if (this.youtubePlayer) {
|
|
943
|
+
const volume = this.config.volume ? this.config.volume * 100 : 100;
|
|
944
|
+
this.youtubePlayer.setVolume(volume);
|
|
945
|
+
if (this.config.muted) {
|
|
946
|
+
this.youtubePlayer.mute();
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
this.startYouTubeTimeTracking();
|
|
950
|
+
this.emit('onReady');
|
|
951
|
+
}
|
|
952
|
+
onYouTubePlayerStateChange(event) {
|
|
953
|
+
const state = event.data;
|
|
954
|
+
switch (state) {
|
|
955
|
+
case window.YT.PlayerState.PLAYING:
|
|
956
|
+
this.state.isPlaying = true;
|
|
957
|
+
this.state.isPaused = false;
|
|
958
|
+
this.state.isBuffering = false;
|
|
959
|
+
this.updateYouTubeUI('playing');
|
|
960
|
+
this.emit('onPlay');
|
|
961
|
+
break;
|
|
962
|
+
case window.YT.PlayerState.PAUSED:
|
|
963
|
+
this.state.isPlaying = false;
|
|
964
|
+
this.state.isPaused = true;
|
|
965
|
+
this.state.isBuffering = false;
|
|
966
|
+
this.updateYouTubeUI('paused');
|
|
967
|
+
this.emit('onPause');
|
|
968
|
+
break;
|
|
969
|
+
case window.YT.PlayerState.BUFFERING:
|
|
970
|
+
this.state.isBuffering = true;
|
|
971
|
+
this.updateYouTubeUI('buffering');
|
|
972
|
+
this.emit('onBuffering', true);
|
|
973
|
+
break;
|
|
974
|
+
case window.YT.PlayerState.ENDED:
|
|
975
|
+
this.state.isPlaying = false;
|
|
976
|
+
this.state.isPaused = true;
|
|
977
|
+
this.state.isEnded = true;
|
|
978
|
+
this.updateYouTubeUI('ended');
|
|
979
|
+
this.emit('onEnded');
|
|
980
|
+
break;
|
|
981
|
+
case window.YT.PlayerState.CUED:
|
|
982
|
+
this.state.duration = this.youtubePlayer.getDuration();
|
|
983
|
+
this.updateYouTubeUI('cued');
|
|
984
|
+
break;
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
updateYouTubeUI(state) {
|
|
988
|
+
const playIcon = document.getElementById('uvf-play-icon');
|
|
989
|
+
const pauseIcon = document.getElementById('uvf-pause-icon');
|
|
990
|
+
const centerPlay = document.getElementById('uvf-center-play');
|
|
991
|
+
if (state === 'playing' || state === 'buffering') {
|
|
992
|
+
if (playIcon)
|
|
993
|
+
playIcon.style.display = 'none';
|
|
994
|
+
if (pauseIcon)
|
|
995
|
+
pauseIcon.style.display = 'block';
|
|
996
|
+
if (centerPlay)
|
|
997
|
+
centerPlay.classList.add('hidden');
|
|
998
|
+
}
|
|
999
|
+
else if (state === 'paused' || state === 'cued' || state === 'ended') {
|
|
1000
|
+
if (playIcon)
|
|
1001
|
+
playIcon.style.display = 'block';
|
|
1002
|
+
if (pauseIcon)
|
|
1003
|
+
pauseIcon.style.display = 'none';
|
|
1004
|
+
if (centerPlay)
|
|
1005
|
+
centerPlay.classList.remove('hidden');
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
onYouTubePlayerError(event) {
|
|
1009
|
+
const errorCode = event.data;
|
|
1010
|
+
let errorMessage = 'YouTube player error';
|
|
1011
|
+
switch (errorCode) {
|
|
1012
|
+
case 2:
|
|
1013
|
+
errorMessage = 'Invalid video ID';
|
|
1014
|
+
break;
|
|
1015
|
+
case 5:
|
|
1016
|
+
errorMessage = 'HTML5 player error';
|
|
1017
|
+
break;
|
|
1018
|
+
case 100:
|
|
1019
|
+
errorMessage = 'Video not found or private';
|
|
1020
|
+
break;
|
|
1021
|
+
case 101:
|
|
1022
|
+
case 150:
|
|
1023
|
+
errorMessage = 'Video cannot be embedded';
|
|
1024
|
+
break;
|
|
1025
|
+
}
|
|
1026
|
+
this.handleError({
|
|
1027
|
+
code: 'YOUTUBE_ERROR',
|
|
1028
|
+
message: errorMessage,
|
|
1029
|
+
type: 'media',
|
|
1030
|
+
fatal: true,
|
|
1031
|
+
details: { errorCode }
|
|
1032
|
+
});
|
|
1033
|
+
}
|
|
1034
|
+
startYouTubeTimeTracking() {
|
|
1035
|
+
if (this.youtubeTimeTrackingInterval) {
|
|
1036
|
+
clearInterval(this.youtubeTimeTrackingInterval);
|
|
1037
|
+
}
|
|
1038
|
+
this.youtubeTimeTrackingInterval = setInterval(() => {
|
|
1039
|
+
if (this.youtubePlayer && this.youtubePlayerReady) {
|
|
1040
|
+
try {
|
|
1041
|
+
const currentTime = this.youtubePlayer.getCurrentTime();
|
|
1042
|
+
const duration = this.youtubePlayer.getDuration();
|
|
1043
|
+
const buffered = this.youtubePlayer.getVideoLoadedFraction() * 100;
|
|
1044
|
+
this.state.currentTime = currentTime || 0;
|
|
1045
|
+
this.state.duration = duration || 0;
|
|
1046
|
+
this.state.bufferedPercentage = buffered || 0;
|
|
1047
|
+
this.updateYouTubeProgressBar(currentTime, duration, buffered);
|
|
1048
|
+
this.emit('onTimeUpdate', this.state.currentTime);
|
|
1049
|
+
this.emit('onProgress', this.state.bufferedPercentage);
|
|
1050
|
+
}
|
|
1051
|
+
catch (error) {
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
}, 250);
|
|
1055
|
+
}
|
|
1056
|
+
updateYouTubeProgressBar(currentTime, duration, buffered) {
|
|
1057
|
+
if (!duration || duration === 0)
|
|
1058
|
+
return;
|
|
1059
|
+
const percent = (currentTime / duration) * 100;
|
|
1060
|
+
const progressFilled = document.getElementById('uvf-progress-filled');
|
|
1061
|
+
if (progressFilled && !this.isDragging) {
|
|
1062
|
+
progressFilled.style.width = percent + '%';
|
|
1063
|
+
}
|
|
1064
|
+
const progressHandle = document.getElementById('uvf-progress-handle');
|
|
1065
|
+
if (progressHandle && !this.isDragging) {
|
|
1066
|
+
progressHandle.style.left = percent + '%';
|
|
1067
|
+
}
|
|
1068
|
+
const progressBuffered = document.getElementById('uvf-progress-buffered');
|
|
1069
|
+
if (progressBuffered) {
|
|
1070
|
+
progressBuffered.style.width = buffered + '%';
|
|
921
1071
|
}
|
|
922
|
-
this.
|
|
1072
|
+
this.updateTimeDisplay();
|
|
923
1073
|
}
|
|
924
1074
|
loadScript(src) {
|
|
925
1075
|
return new Promise((resolve, reject) => {
|
|
@@ -1286,6 +1436,10 @@ export class WebPlayer extends BasePlayer {
|
|
|
1286
1436
|
}
|
|
1287
1437
|
}
|
|
1288
1438
|
async play() {
|
|
1439
|
+
if (this.youtubePlayer && this.youtubePlayerReady) {
|
|
1440
|
+
this.youtubePlayer.playVideo();
|
|
1441
|
+
return;
|
|
1442
|
+
}
|
|
1289
1443
|
if (!this.video)
|
|
1290
1444
|
throw new Error('Video element not initialized');
|
|
1291
1445
|
if (this.isFallbackPosterMode) {
|
|
@@ -1337,6 +1491,10 @@ export class WebPlayer extends BasePlayer {
|
|
|
1337
1491
|
}
|
|
1338
1492
|
}
|
|
1339
1493
|
pause() {
|
|
1494
|
+
if (this.youtubePlayer && this.youtubePlayerReady) {
|
|
1495
|
+
this.youtubePlayer.pauseVideo();
|
|
1496
|
+
return;
|
|
1497
|
+
}
|
|
1340
1498
|
if (!this.video)
|
|
1341
1499
|
return;
|
|
1342
1500
|
const now = Date.now();
|
|
@@ -1393,6 +1551,12 @@ export class WebPlayer extends BasePlayer {
|
|
|
1393
1551
|
}
|
|
1394
1552
|
}
|
|
1395
1553
|
seek(time) {
|
|
1554
|
+
if (this.youtubePlayer && this.youtubePlayerReady) {
|
|
1555
|
+
this.youtubePlayer.seekTo(time, true);
|
|
1556
|
+
this.emit('onSeeking');
|
|
1557
|
+
setTimeout(() => this.emit('onSeeked'), 500);
|
|
1558
|
+
return;
|
|
1559
|
+
}
|
|
1396
1560
|
if (!this.video)
|
|
1397
1561
|
return;
|
|
1398
1562
|
if (!isFinite(time) || isNaN(time)) {
|
|
@@ -1412,24 +1576,37 @@ export class WebPlayer extends BasePlayer {
|
|
|
1412
1576
|
this.safeSetCurrentTime(time);
|
|
1413
1577
|
}
|
|
1414
1578
|
setVolume(level) {
|
|
1579
|
+
if (this.youtubePlayer && this.youtubePlayerReady) {
|
|
1580
|
+
const volumePercent = level * 100;
|
|
1581
|
+
this.youtubePlayer.setVolume(volumePercent);
|
|
1582
|
+
}
|
|
1415
1583
|
if (!this.video)
|
|
1416
1584
|
return;
|
|
1417
1585
|
this.video.volume = Math.max(0, Math.min(1, level));
|
|
1418
1586
|
super.setVolume(level);
|
|
1419
1587
|
}
|
|
1420
1588
|
mute() {
|
|
1589
|
+
if (this.youtubePlayer && this.youtubePlayerReady) {
|
|
1590
|
+
this.youtubePlayer.mute();
|
|
1591
|
+
}
|
|
1421
1592
|
if (!this.video)
|
|
1422
1593
|
return;
|
|
1423
1594
|
this.video.muted = true;
|
|
1424
1595
|
super.mute();
|
|
1425
1596
|
}
|
|
1426
1597
|
unmute() {
|
|
1598
|
+
if (this.youtubePlayer && this.youtubePlayerReady) {
|
|
1599
|
+
this.youtubePlayer.unMute();
|
|
1600
|
+
}
|
|
1427
1601
|
if (!this.video)
|
|
1428
1602
|
return;
|
|
1429
1603
|
this.video.muted = false;
|
|
1430
1604
|
super.unmute();
|
|
1431
1605
|
}
|
|
1432
1606
|
getCurrentTime() {
|
|
1607
|
+
if (this.youtubePlayer && this.youtubePlayerReady) {
|
|
1608
|
+
return this.youtubePlayer.getCurrentTime();
|
|
1609
|
+
}
|
|
1433
1610
|
if (this.video && typeof this.video.currentTime === 'number') {
|
|
1434
1611
|
return this.video.currentTime;
|
|
1435
1612
|
}
|
|
@@ -5820,6 +5997,7 @@ export class WebPlayer extends BasePlayer {
|
|
|
5820
5997
|
const progressBar = document.getElementById('uvf-progress-bar');
|
|
5821
5998
|
const fullscreenBtn = document.getElementById('uvf-fullscreen-btn');
|
|
5822
5999
|
const settingsBtn = document.getElementById('uvf-settings-btn');
|
|
6000
|
+
const getEventTarget = () => this.youtubePlayer && this.youtubePlayerReady ? this.youtubePlayer : this.video;
|
|
5823
6001
|
this.video.addEventListener('contextmenu', (e) => {
|
|
5824
6002
|
e.preventDefault();
|
|
5825
6003
|
return false;
|