latest update my Video Platform is working Great

This commit is contained in:
ghassan committed 2026-02-26 21:29:52 +03:00
1 parent eb707c1ee1
commit dcdcafe0ba
9 files changed
+389 -118

No files matched your search

+77 -14
View File
@@ -1,5 +1,21 @@
@extends('layouts.app')
@push('head')
<!-- Open Graph / WhatsApp / Facebook / Twitter Preview -->
<meta property="og:title" content="{{ $video->title }}">
<meta property="og:description" content="{{ $video->description ? Str::limit($video->description, 200) : 'Check out this video on TAKEONE' }}">
<meta property="og:image" content="{{ $video->thumbnail_url }}">
<meta property="og:url" content="{{ $video->share_url }}">
<meta property="og:type" content="video.other">
<meta property="og:site_name" content="TAKEONE">
<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="{{ $video->title }}">
<meta name="twitter:description" content="{{ $video->description ? Str::limit($video->description, 200) : 'Check out this video on TAKEONE' }}">
<meta name="twitter:image" content="{{ $video->thumbnail_url }}">
@endpush
@section('title', $video->title . ' | TAKEONE')
@section('extra_styles')
@@ -18,11 +34,19 @@
display: flex;
justify-content: center;
align-items: center;
width: 100%;
}
.video-container.portrait { aspect-ratio: 9/16; }
.video-container.square { aspect-ratio: 1/1; }
.video-container.ultrawide { aspect-ratio: 21/9; }
.video-container.portrait,
.video-container.square,
.video-container.ultrawide {
margin: 0 auto;
width: auto;
}
.video-container.portrait { aspect-ratio: 9/16; max-width: 50vh; }
.video-container.square { aspect-ratio: 1/1; max-width: 70vh; }
.video-container.ultrawide { aspect-ratio: 21/9; max-width: 100%; }
.video-container video { width: 100%; height: 100%; object-fit: contain; }
@@ -171,24 +195,64 @@
.yt-header-center { display: none; }
.sidebar-video-card { flex-direction: column; }
.sidebar-thumb { width: 100%; }
/* Video Layout Container - Stack vertically on tablet/mobile */
.video-layout-container {
flex-direction: column !important;
}
.yt-video-section {
width: 100% !important;
flex: none !important;
}
.yt-sidebar-container {
width: 100% !important;
margin-top: 16px;
}
}
@media (max-width: 576px) {
.video-stats-row { flex-direction: column; align-items: flex-start; }
.video-actions { width: 100%; overflow-x: auto; justify-content: flex-start; }
.yt-main { padding: 16px; }
.yt-main { padding: 12px !important; }
/* Mobile video player fixes */
.video-container {
max-height: 50vh !important;
border-radius: 0 !important;
}
.video-container video {
object-fit: contain !important;
}
.video-title {
font-size: 16px !important;
margin: 12px 0 6px !important;
}
.channel-row {
flex-direction: column;
align-items: flex-start !important;
gap: 12px;
}
.channel-info {
width: 100%;
}
.subscribe-btn {
width: 100%;
}
.video-description {
padding: 12px !important;
}
}
</style>
@endsection
@section('content')
<!-- Video Layout Container -->
<div style="display: flex; gap: 24px; max-width: 1800px; margin: 0 auto;">
<div class="video-layout-container" style="display: flex; gap: 24px; max-width: 1800px; margin: 0 auto;">
<!-- Video Section -->
<div class="yt-video-section">
<!-- Video Player -->
<div class="video-container @if($video->orientation === 'portrait') portrait @elseif($video->orientation === 'square') square @elseif($video->orientation === 'ultrawide') ultrawide @endif" id="videoContainer">
<video id="videoPlayer" controls playsinline preload="metadata">
<video id="videoPlayer" controls playsinline preload="metadata" autoplay>
<source src="{{ route('videos.stream', $video->id) }}" type="video/mp4">
</video>
</div>
@@ -285,20 +349,19 @@
document.addEventListener('DOMContentLoaded', function() {
var videoPlayer = document.getElementById('videoPlayer');
if (videoPlayer) {
// Try to autoplay with sound (works because user just clicked on the video)
// Set volume to 50%
videoPlayer.volume = 0.5;
// Try to autoplay with sound
var playPromise = videoPlayer.play();
if (playPromise !== undefined) {
playPromise.then(function() {
// Autoplay started successfully
console.log('Video autoplayed with sound');
console.log('Video autoplayed with sound at 50% volume');
}).catch(function(error) {
// Autoplay was prevented, try muted
console.log('Autoplay blocked, attempting muted autoplay');
videoPlayer.muted = true;
videoPlayer.play().catch(function(e) {
console.log('Muted autoplay also blocked');
});
// Autoplay was prevented
console.log('Autoplay blocked');
});
}
}