Enable video ads for monetization and improved user experience
Reintroduce VAST player integration for video advertisements within the modal, enhancing monetization capabilities. Replit-Commit-Author: Agent Replit-Commit-Session-Id: d7424866-83d1-4486-a212-ac12b4c7becf Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/d7424866-83d1-4486-a212-ac12b4c7becf/YUihGE9
This commit is contained in:
parent
08418ec877
commit
943b082678
BIN
attached_assets/image_1754683243158.png
Normal file
BIN
attached_assets/image_1754683243158.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 46 KiB |
@ -57,11 +57,6 @@ function formatDate(date: Date | string): string {
|
||||
|
||||
export default function VideoModal({ video, isOpen, onClose, enableAds = true }: VideoModalProps) {
|
||||
const [useVASTPlayer, setUseVASTPlayer] = useState(true);
|
||||
|
||||
// Switch to VAST player for monetization
|
||||
if (isOpen && video && useVASTPlayer && enableAds) {
|
||||
return <VASTPlayer video={video} onClose={onClose} enableAds={enableAds} />;
|
||||
}
|
||||
const videoRef = useRef<HTMLVideoElement>(null);
|
||||
const hlsRef = useRef<Hls | null>(null);
|
||||
const [showShareMenu, setShowShareMenu] = useState(false);
|
||||
@ -75,6 +70,11 @@ export default function VideoModal({ video, isOpen, onClose, enableAds = true }:
|
||||
const [duration, setDuration] = useState(0);
|
||||
const [volume, setVolume] = useState(1);
|
||||
const [hoverTime, setHoverTime] = useState(-1);
|
||||
|
||||
// Switch to VAST player for monetization
|
||||
if (isOpen && video && useVASTPlayer && enableAds) {
|
||||
return <VASTPlayer video={video} onClose={onClose} enableAds={enableAds} />;
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
const handleEscape = (e: KeyboardEvent) => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user