unified-video-framework 1.4.34 → 1.4.35
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/web/dist/WebPlayer.d.ts +11 -0
- package/packages/web/dist/WebPlayer.d.ts.map +1 -1
- package/packages/web/dist/WebPlayer.js +203 -8
- package/packages/web/dist/WebPlayer.js.map +1 -1
- package/packages/web/dist/paywall/PaywallController.d.ts.map +1 -1
- package/packages/web/dist/paywall/PaywallController.js +100 -33
- package/packages/web/dist/paywall/PaywallController.js.map +1 -1
- package/packages/web/src/WebPlayer.ts +274 -9
- package/packages/web/src/paywall/PaywallController.ts +128 -41
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unified-video-framework",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.35",
|
|
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",
|
|
@@ -24,6 +24,12 @@ export declare class WebPlayer extends BasePlayer {
|
|
|
24
24
|
private watermarkCanvas;
|
|
25
25
|
private playerWrapper;
|
|
26
26
|
private previewGateHit;
|
|
27
|
+
private isPaywallActive;
|
|
28
|
+
private lastAuthValidation;
|
|
29
|
+
private authValidationInterval;
|
|
30
|
+
private securityChecksPassed;
|
|
31
|
+
private overlayRemovalAttempts;
|
|
32
|
+
private maxOverlayRemovalAttempts;
|
|
27
33
|
private castContext;
|
|
28
34
|
private remotePlayer;
|
|
29
35
|
private remoteController;
|
|
@@ -74,6 +80,11 @@ export declare class WebPlayer extends BasePlayer {
|
|
|
74
80
|
private enforceFreePreviewGate;
|
|
75
81
|
setFreeDuration(seconds: number): void;
|
|
76
82
|
resetFreePreviewGate(): void;
|
|
83
|
+
private canPlayVideo;
|
|
84
|
+
private enforcePaywallSecurity;
|
|
85
|
+
private startOverlayMonitoring;
|
|
86
|
+
private handleSecurityViolation;
|
|
87
|
+
private showSecurityViolationMessage;
|
|
77
88
|
private toggleMuteAction;
|
|
78
89
|
private handleVolumeChange;
|
|
79
90
|
private handleProgressChange;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebPlayer.d.ts","sourceRoot":"","sources":["../src/WebPlayer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAUjD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,GAAG,EAAE,GAAG,CAAC;QACT,MAAM,EAAE,GAAG,CAAC;QACZ,IAAI,CAAC,EAAE,GAAG,CAAC;QACX,MAAM,CAAC,EAAE,GAAG,CAAC;QACb,qBAAqB,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;KACxD;CACF;AAED,qBAAa,SAAU,SAAQ,UAAU;IACvC,SAAS,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAAQ;IAChD,OAAO,CAAC,GAAG,CAAa;IACxB,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,mBAAmB,CAAc;IACzC,OAAO,CAAC,WAAW,CAAiB;IACpC,OAAO,CAAC,iBAAiB,CAAiB;IAC1C,OAAO,CAAC,iBAAiB,CAA4B;IACrD,OAAO,CAAC,mBAAmB,CAAa;IACxC,OAAO,CAAC,iBAAiB,CAAa;IACtC,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,eAAe,CAAkC;IACzD,OAAO,CAAC,aAAa,CAA4B;IAEjD,OAAO,CAAC,cAAc,CAAkB;IAGxC,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,YAAY,CAAa;IACjC,OAAO,CAAC,gBAAgB,CAAa;IACrC,OAAO,CAAC,SAAS,CAA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CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAwB1F,OAAO,CAAC,oCAAoC;IAqBrC,QAAQ,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI;IA2DjC,OAAO,CAAC,SAAS;IA8BjB,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,WAAW;IAUnB,OAAO,CAAC,OAAO;IAOf,OAAO,CAAC,YAAY;IAmBpB,OAAO,CAAC,QAAQ;IAahB,OAAO,CAAC,iBAAiB;YAgCX,SAAS;IAYvB,OAAO,CAAC,oBAAoB;IAS5B,OAAO,CAAC,gBAAgB;IA6BxB,OAAO,CAAC,uBAAuB;IAoB/B,OAAO,CAAC,wBAAwB;IAKhC,OAAO,CAAC,uBAAuB;IA6D/B,OAAO,CAAC,wBAAwB;IAoBhC,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,gBAAgB;IA6BxB,OAAO,CAAC,uBAAuB;IAqB/B,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,WAAW;YAoBL,QAAQ;YAqGR,UAAU;IAqBxB,OAAO,CAAC,gBAAgB;IA2CxB,OAAO,CAAC,gBAAgB;YAKV,OAAO;IAgBf,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CA0C/B"}
|
|
@@ -17,6 +17,12 @@ export class WebPlayer extends BasePlayer {
|
|
|
17
17
|
this.watermarkCanvas = null;
|
|
18
18
|
this.playerWrapper = null;
|
|
19
19
|
this.previewGateHit = false;
|
|
20
|
+
this.isPaywallActive = false;
|
|
21
|
+
this.lastAuthValidation = 0;
|
|
22
|
+
this.authValidationInterval = null;
|
|
23
|
+
this.securityChecksPassed = false;
|
|
24
|
+
this.overlayRemovalAttempts = 0;
|
|
25
|
+
this.maxOverlayRemovalAttempts = 3;
|
|
20
26
|
this.castContext = null;
|
|
21
27
|
this.remotePlayer = null;
|
|
22
28
|
this.remoteController = null;
|
|
@@ -69,12 +75,23 @@ export class WebPlayer extends BasePlayer {
|
|
|
69
75
|
const { PaywallController } = await import('./paywall/PaywallController');
|
|
70
76
|
this.paywallController = new PaywallController(pw, {
|
|
71
77
|
getOverlayContainer: () => this.playerWrapper,
|
|
72
|
-
onResume: () => {
|
|
73
|
-
|
|
78
|
+
onResume: () => {
|
|
79
|
+
try {
|
|
80
|
+
this.resetFreePreviewGate();
|
|
81
|
+
this.play();
|
|
82
|
+
}
|
|
83
|
+
catch (_) { }
|
|
84
|
+
},
|
|
85
|
+
onShow: () => {
|
|
86
|
+
this.isPaywallActive = true;
|
|
87
|
+
this.startOverlayMonitoring();
|
|
88
|
+
},
|
|
89
|
+
onClose: () => {
|
|
90
|
+
this.isPaywallActive = false;
|
|
91
|
+
if (this.authValidationInterval) {
|
|
92
|
+
clearInterval(this.authValidationInterval);
|
|
93
|
+
}
|
|
74
94
|
}
|
|
75
|
-
catch (_) { } },
|
|
76
|
-
onShow: () => { },
|
|
77
|
-
onClose: () => { }
|
|
78
95
|
});
|
|
79
96
|
this.on('onFreePreviewEnded', () => {
|
|
80
97
|
console.log('[WebPlayer] onFreePreviewEnded event triggered, calling paywallController.openOverlay()');
|
|
@@ -404,6 +421,11 @@ export class WebPlayer extends BasePlayer {
|
|
|
404
421
|
async play() {
|
|
405
422
|
if (!this.video)
|
|
406
423
|
throw new Error('Video element not initialized');
|
|
424
|
+
if (!this.canPlayVideo()) {
|
|
425
|
+
console.warn('[WebPlayer] Playback blocked by security check');
|
|
426
|
+
this.enforcePaywallSecurity();
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
407
429
|
try {
|
|
408
430
|
await this.video.play();
|
|
409
431
|
await super.play();
|
|
@@ -428,6 +450,16 @@ export class WebPlayer extends BasePlayer {
|
|
|
428
450
|
seek(time) {
|
|
429
451
|
if (!this.video)
|
|
430
452
|
return;
|
|
453
|
+
const freeDuration = Number(this.config.freeDuration || 0);
|
|
454
|
+
if (freeDuration > 0 && !this.securityChecksPassed) {
|
|
455
|
+
const requestedTime = Math.max(0, Math.min(time, this.video.duration || time));
|
|
456
|
+
if (requestedTime >= freeDuration) {
|
|
457
|
+
console.warn('[WebPlayer] Seek blocked - beyond free preview limit');
|
|
458
|
+
this.enforcePaywallSecurity();
|
|
459
|
+
this.video.currentTime = Math.max(0, freeDuration - 1);
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
431
463
|
const d = this.video.duration;
|
|
432
464
|
if (typeof d === 'number' && isFinite(d) && d > 0) {
|
|
433
465
|
this.video.currentTime = Math.max(0, Math.min(time, d));
|
|
@@ -2440,13 +2472,23 @@ export class WebPlayer extends BasePlayer {
|
|
|
2440
2472
|
if (e.target.tagName === 'INPUT' ||
|
|
2441
2473
|
e.target.tagName === 'TEXTAREA')
|
|
2442
2474
|
return;
|
|
2475
|
+
if (this.isPaywallActive && !this.securityChecksPassed) {
|
|
2476
|
+
console.warn('[WebPlayer] Keyboard shortcuts blocked - paywall active');
|
|
2477
|
+
e.preventDefault();
|
|
2478
|
+
return;
|
|
2479
|
+
}
|
|
2443
2480
|
let shortcutText = '';
|
|
2444
2481
|
switch (e.key) {
|
|
2445
2482
|
case ' ':
|
|
2446
2483
|
case 'k':
|
|
2447
2484
|
e.preventDefault();
|
|
2448
|
-
this.
|
|
2449
|
-
|
|
2485
|
+
if (this.canPlayVideo()) {
|
|
2486
|
+
this.togglePlayPause();
|
|
2487
|
+
shortcutText = this.state.isPlaying ? 'Pause' : 'Play';
|
|
2488
|
+
}
|
|
2489
|
+
else {
|
|
2490
|
+
this.enforcePaywallSecurity();
|
|
2491
|
+
}
|
|
2450
2492
|
break;
|
|
2451
2493
|
case 'ArrowLeft':
|
|
2452
2494
|
e.preventDefault();
|
|
@@ -2586,8 +2628,8 @@ export class WebPlayer extends BasePlayer {
|
|
|
2586
2628
|
getOverlayContainer: () => this.playerWrapper,
|
|
2587
2629
|
onResume: () => {
|
|
2588
2630
|
try {
|
|
2631
|
+
this.resetFreePreviewGate();
|
|
2589
2632
|
this.play();
|
|
2590
|
-
this.previewGateHit = false;
|
|
2591
2633
|
}
|
|
2592
2634
|
catch (_) { }
|
|
2593
2635
|
},
|
|
@@ -2596,8 +2638,14 @@ export class WebPlayer extends BasePlayer {
|
|
|
2596
2638
|
this.pause();
|
|
2597
2639
|
}
|
|
2598
2640
|
catch (_) { }
|
|
2641
|
+
this.isPaywallActive = true;
|
|
2642
|
+
this.startOverlayMonitoring();
|
|
2599
2643
|
},
|
|
2600
2644
|
onClose: () => {
|
|
2645
|
+
this.isPaywallActive = false;
|
|
2646
|
+
if (this.authValidationInterval) {
|
|
2647
|
+
clearInterval(this.authValidationInterval);
|
|
2648
|
+
}
|
|
2601
2649
|
}
|
|
2602
2650
|
});
|
|
2603
2651
|
}).catch(() => { });
|
|
@@ -2673,6 +2721,142 @@ export class WebPlayer extends BasePlayer {
|
|
|
2673
2721
|
}
|
|
2674
2722
|
resetFreePreviewGate() {
|
|
2675
2723
|
this.previewGateHit = false;
|
|
2724
|
+
this.securityChecksPassed = true;
|
|
2725
|
+
this.isPaywallActive = false;
|
|
2726
|
+
this.overlayRemovalAttempts = 0;
|
|
2727
|
+
console.log('[WebPlayer] Free preview gate reset - access granted');
|
|
2728
|
+
}
|
|
2729
|
+
canPlayVideo() {
|
|
2730
|
+
const freeDuration = Number(this.config.freeDuration || 0);
|
|
2731
|
+
const currentTime = this.video?.currentTime || 0;
|
|
2732
|
+
if (freeDuration <= 0)
|
|
2733
|
+
return true;
|
|
2734
|
+
if (this.securityChecksPassed)
|
|
2735
|
+
return true;
|
|
2736
|
+
if (currentTime < freeDuration)
|
|
2737
|
+
return true;
|
|
2738
|
+
if (this.paywallController &&
|
|
2739
|
+
typeof this.paywallController.isAuthenticated === 'function') {
|
|
2740
|
+
const isAuth = this.paywallController.isAuthenticated();
|
|
2741
|
+
if (isAuth) {
|
|
2742
|
+
this.securityChecksPassed = true;
|
|
2743
|
+
return true;
|
|
2744
|
+
}
|
|
2745
|
+
}
|
|
2746
|
+
return false;
|
|
2747
|
+
}
|
|
2748
|
+
enforcePaywallSecurity() {
|
|
2749
|
+
console.log('[WebPlayer] Enforcing paywall security');
|
|
2750
|
+
try {
|
|
2751
|
+
if (this.video && !this.video.paused) {
|
|
2752
|
+
this.video.pause();
|
|
2753
|
+
}
|
|
2754
|
+
}
|
|
2755
|
+
catch (_) { }
|
|
2756
|
+
this.isPaywallActive = true;
|
|
2757
|
+
if (this.paywallController) {
|
|
2758
|
+
try {
|
|
2759
|
+
this.paywallController.openOverlay();
|
|
2760
|
+
}
|
|
2761
|
+
catch (error) {
|
|
2762
|
+
console.error('[WebPlayer] Error showing paywall overlay:', error);
|
|
2763
|
+
}
|
|
2764
|
+
}
|
|
2765
|
+
this.startOverlayMonitoring();
|
|
2766
|
+
}
|
|
2767
|
+
startOverlayMonitoring() {
|
|
2768
|
+
if (!this.playerWrapper)
|
|
2769
|
+
return;
|
|
2770
|
+
if (this.authValidationInterval) {
|
|
2771
|
+
clearInterval(this.authValidationInterval);
|
|
2772
|
+
}
|
|
2773
|
+
this.authValidationInterval = setInterval(() => {
|
|
2774
|
+
if (!this.isPaywallActive || this.securityChecksPassed) {
|
|
2775
|
+
clearInterval(this.authValidationInterval);
|
|
2776
|
+
return;
|
|
2777
|
+
}
|
|
2778
|
+
const paywallOverlays = this.playerWrapper.querySelectorAll('.uvf-paywall-overlay, .uvf-auth-overlay');
|
|
2779
|
+
const visibleOverlays = Array.from(paywallOverlays).filter(overlay => {
|
|
2780
|
+
const element = overlay;
|
|
2781
|
+
return element.style.display !== 'none' &&
|
|
2782
|
+
element.offsetParent !== null &&
|
|
2783
|
+
window.getComputedStyle(element).visibility !== 'hidden';
|
|
2784
|
+
});
|
|
2785
|
+
if (visibleOverlays.length === 0) {
|
|
2786
|
+
this.overlayRemovalAttempts++;
|
|
2787
|
+
console.warn(`[WebPlayer] Overlay removal attempt detected (${this.overlayRemovalAttempts}/${this.maxOverlayRemovalAttempts})`);
|
|
2788
|
+
if (this.overlayRemovalAttempts >= this.maxOverlayRemovalAttempts) {
|
|
2789
|
+
this.handleSecurityViolation();
|
|
2790
|
+
}
|
|
2791
|
+
else {
|
|
2792
|
+
this.enforcePaywallSecurity();
|
|
2793
|
+
}
|
|
2794
|
+
}
|
|
2795
|
+
if (this.video && !this.video.paused && !this.securityChecksPassed) {
|
|
2796
|
+
console.warn('[WebPlayer] Unauthorized playback detected, pausing video');
|
|
2797
|
+
try {
|
|
2798
|
+
this.video.pause();
|
|
2799
|
+
this.video.currentTime = Math.max(0, Number(this.config.freeDuration || 0) - 1);
|
|
2800
|
+
}
|
|
2801
|
+
catch (_) { }
|
|
2802
|
+
}
|
|
2803
|
+
}, 500);
|
|
2804
|
+
}
|
|
2805
|
+
handleSecurityViolation() {
|
|
2806
|
+
console.error('[WebPlayer] Security violation detected - disabling video');
|
|
2807
|
+
if (this.video) {
|
|
2808
|
+
this.video.pause();
|
|
2809
|
+
this.video.currentTime = 0;
|
|
2810
|
+
this.video.src = '';
|
|
2811
|
+
this.video.style.display = 'none';
|
|
2812
|
+
}
|
|
2813
|
+
this.showSecurityViolationMessage();
|
|
2814
|
+
if (this.authValidationInterval) {
|
|
2815
|
+
clearInterval(this.authValidationInterval);
|
|
2816
|
+
}
|
|
2817
|
+
}
|
|
2818
|
+
showSecurityViolationMessage() {
|
|
2819
|
+
if (!this.playerWrapper)
|
|
2820
|
+
return;
|
|
2821
|
+
this.playerWrapper.innerHTML = '';
|
|
2822
|
+
const securityOverlay = document.createElement('div');
|
|
2823
|
+
securityOverlay.style.cssText = `
|
|
2824
|
+
position: absolute;
|
|
2825
|
+
inset: 0;
|
|
2826
|
+
background: rgba(0, 0, 0, 0.95);
|
|
2827
|
+
display: flex;
|
|
2828
|
+
align-items: center;
|
|
2829
|
+
justify-content: center;
|
|
2830
|
+
z-index: 2147483647;
|
|
2831
|
+
color: #ff6b6b;
|
|
2832
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
2833
|
+
text-align: center;
|
|
2834
|
+
padding: 40px;
|
|
2835
|
+
`;
|
|
2836
|
+
const messageContainer = document.createElement('div');
|
|
2837
|
+
messageContainer.innerHTML = `
|
|
2838
|
+
<div style="font-size: 24px; font-weight: bold; margin-bottom: 16px; color: #ff6b6b;">
|
|
2839
|
+
🔒 Security Violation Detected
|
|
2840
|
+
</div>
|
|
2841
|
+
<div style="font-size: 16px; line-height: 1.5; color: rgba(255, 255, 255, 0.9);">
|
|
2842
|
+
Unauthorized access attempt detected.<br>
|
|
2843
|
+
Please refresh the page and complete authentication to continue.
|
|
2844
|
+
</div>
|
|
2845
|
+
<div style="margin-top: 24px;">
|
|
2846
|
+
<button onclick="window.location.reload()" style="
|
|
2847
|
+
background: #ff4d4f;
|
|
2848
|
+
color: white;
|
|
2849
|
+
border: none;
|
|
2850
|
+
padding: 12px 24px;
|
|
2851
|
+
border-radius: 8px;
|
|
2852
|
+
cursor: pointer;
|
|
2853
|
+
font-size: 14px;
|
|
2854
|
+
font-weight: 600;
|
|
2855
|
+
">Reload Page</button>
|
|
2856
|
+
</div>
|
|
2857
|
+
`;
|
|
2858
|
+
securityOverlay.appendChild(messageContainer);
|
|
2859
|
+
this.playerWrapper.appendChild(securityOverlay);
|
|
2676
2860
|
}
|
|
2677
2861
|
toggleMuteAction() {
|
|
2678
2862
|
if (this.isCasting && this.remoteController) {
|
|
@@ -3645,6 +3829,17 @@ export class WebPlayer extends BasePlayer {
|
|
|
3645
3829
|
if (this.volumeHideTimeout) {
|
|
3646
3830
|
clearTimeout(this.volumeHideTimeout);
|
|
3647
3831
|
}
|
|
3832
|
+
if (this.authValidationInterval) {
|
|
3833
|
+
clearInterval(this.authValidationInterval);
|
|
3834
|
+
this.authValidationInterval = null;
|
|
3835
|
+
}
|
|
3836
|
+
this.isPaywallActive = false;
|
|
3837
|
+
this.securityChecksPassed = false;
|
|
3838
|
+
this.overlayRemovalAttempts = 0;
|
|
3839
|
+
if (this.paywallController && typeof this.paywallController.destroy === 'function') {
|
|
3840
|
+
this.paywallController.destroy();
|
|
3841
|
+
this.paywallController = null;
|
|
3842
|
+
}
|
|
3648
3843
|
if (this.video) {
|
|
3649
3844
|
this.video.pause();
|
|
3650
3845
|
this.video.removeAttribute('src');
|