latest update my Video Platform is working Great
This commit is contained in:
1 parent
eb707c1ee1
commit
dcdcafe0ba
9 files changed
+389
-118
No files matched your search
@@ -331,7 +331,7 @@ function playVideo(card) {
|
||||
const video = card.querySelector('video');
|
||||
if (video) {
|
||||
video.currentTime = 0;
|
||||
video.volume = 0.25; // Set volume to 25%
|
||||
video.volume = 0.10; // Set volume to 10%
|
||||
video.play().catch(function(e) {
|
||||
// Auto-play may be blocked, ignore error
|
||||
});
|
||||
@@ -347,6 +347,27 @@ function stopVideo(card) {
|
||||
video.classList.remove('active');
|
||||
}
|
||||
}
|
||||
|
||||
// Mobile touch support for hover-like behavior
|
||||
document.addEventListener('touchstart', function(e) {
|
||||
const card = e.target.closest('.yt-video-card');
|
||||
if (card) {
|
||||
// Stop any other playing videos first
|
||||
document.querySelectorAll('.yt-video-card').forEach(function(otherCard) {
|
||||
if (otherCard !== card) {
|
||||
stopVideo(otherCard);
|
||||
}
|
||||
});
|
||||
playVideo(card);
|
||||
}
|
||||
}, { passive: true });
|
||||
|
||||
document.addEventListener('touchend', function(e) {
|
||||
const card = e.target.closest('.yt-video-card');
|
||||
if (card) {
|
||||
stopVideo(card);
|
||||
}
|
||||
}, { passive: true });
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
Reference in new issue
Block a user