mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-05-18 16:02:25 +00:00
Fix for switching videos, also style fix
This commit is contained in:
parent
152721a5d5
commit
d750872ba5
@ -72,7 +72,23 @@ const InteractivePromotionalCarousel = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (videoRef.current && selectedPromotion.video) {
|
if (videoRef.current && selectedPromotion.video) {
|
||||||
videoRef.current.play();
|
const playVideo = async () => {
|
||||||
|
try {
|
||||||
|
videoRef.current.load();
|
||||||
|
await videoRef.current.play();
|
||||||
|
} catch (error) {
|
||||||
|
console.warn('Video playback failed:', error);
|
||||||
|
setTimeout(async () => {
|
||||||
|
try {
|
||||||
|
await videoRef.current?.play();
|
||||||
|
} catch (retryError) {
|
||||||
|
console.warn('Video retry failed:', retryError);
|
||||||
|
}
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
playVideo();
|
||||||
}
|
}
|
||||||
}, [selectedPromotion]);
|
}, [selectedPromotion]);
|
||||||
|
|
||||||
@ -87,6 +103,7 @@ const InteractivePromotionalCarousel = () => {
|
|||||||
loop
|
loop
|
||||||
muted
|
muted
|
||||||
playsInline
|
playsInline
|
||||||
|
onError={(e) => console.warn('Video error:', e)}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<Image
|
<Image
|
||||||
@ -141,7 +158,7 @@ const InteractivePromotionalCarousel = () => {
|
|||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<div className="absolute inset-0 from-black via-black/70 to-transparent rounded-lg" />
|
<div className="absolute inset-0 from-black via-black/70 to-transparent rounded-lg" />
|
||||||
<div className={`bg-gray-800/90 rounded-tr-lg absolute bottom-0 left-0 p-4 space-y-2 ${isTabView ? 'pb-16' : 'max-w-[80%]'}`}>
|
<div className={`bg-gray-800/90 rounded-tr-lg absolute bottom-0 left-0 p-4 space-y-2 rounded-bl-lg ${isTabView ? 'pb-16' : 'max-w-[80%]'}`}>
|
||||||
<div className="uppercase text-sm font-bold text-[#f8f8ff]">{selectedPromotion.category}</div>
|
<div className="uppercase text-sm font-bold text-[#f8f8ff]">{selectedPromotion.category}</div>
|
||||||
<h2 className="font-bold leading-tight text-white drop-shadow-lg">
|
<h2 className="font-bold leading-tight text-white drop-shadow-lg">
|
||||||
{selectedPromotion.title}
|
{selectedPromotion.title}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user