From dcdcafe0bac553515a12376189a1dca6c67340aa Mon Sep 17 00:00:00 2001 From: ghassan Date: Thu, 26 Feb 2026 21:29:52 +0300 Subject: [PATCH] latest update my Video Platform is working Great --- TODO.md | 44 +++-- app/Http/Controllers/VideoController.php | 2 +- resources/views/layouts/app.blade.php | 153 ++++++++++++++++-- .../partials/edit-video-modal.blade.php | 46 +++--- .../views/layouts/partials/header.blade.php | 5 + .../layouts/partials/upload-modal.blade.php | 113 ++++++++----- resources/views/videos/create.blade.php | 30 +++- resources/views/videos/index.blade.php | 23 ++- resources/views/videos/show.blade.php | 91 +++++++++-- 9 files changed, 389 insertions(+), 118 deletions(-) diff --git a/TODO.md b/TODO.md index 423015e..13d1c2d 100644 --- a/TODO.md +++ b/TODO.md @@ -1,33 +1,27 @@ -# TODO: Add Delete and Edit options to channel video 3-dot menu +# TODO: Two-Stage Upload Modal Implementation ## Task -In `https://video.innovator.bh/channel/2`, the 3-dot menu must have Delete and Edit options. +Restructure the video upload modal to have: +- Stage 1: Upload video file (with progress bar) +- Stage 2: Title and Description +- Stage 3: Thumbnail +- Stage 4: Privacy settings -## Requirements -- `/videos` (public area) - NO edit/delete options -- `/channel/{id}` (user channel page) - Edit and Delete options for the channel owner only +## Implementation Steps -## Plan +### Step 1: Update VideoController.php ✅ +- [x] Add new endpoint for temp video upload (returns temp filename) +- [x] Modify store method to handle two-step process -### Step 1: Modify app.blade.php -- Add include for edit-video-modal partial +### Step 2: Update routes/web.php ✅ +- [x] Add route for temp video upload -### Step 2: Modify channel.blade.php -- Add conditional check for video ownership -- Add Edit button that calls openEditVideoModal() -- Add Delete button with confirmation -- Add separator before owner-only options +### Step 3: Update upload-modal.blade.php ✅ +- [x] Restructure steps: Video → Details → Thumbnail → Privacy +- [x] Update step indicators +- [x] Add video upload with progress bar in Stage 1 +- [x] Update JavaScript for new flow -### Step 3: Add JavaScript for delete functionality -- Add deleteVideo() function with AJAX call +### Step 4: Test +- [ ] Test the complete upload flow -### Step 4: Update VideoController -- Add ownership check to destroy method -- Return JSON for AJAX requests - -## Status: Completed - -## Files Modified -1. `resources/views/layouts/app.blade.php` - Added edit-video-modal include -2. `resources/views/user/channel.blade.php` - Added Edit/Delete in dropdown -3. `app/Http/Controllers/VideoController.php` - Updated destroy method diff --git a/app/Http/Controllers/VideoController.php b/app/Http/Controllers/VideoController.php index bd519c2..461a2b1 100644 --- a/app/Http/Controllers/VideoController.php +++ b/app/Http/Controllers/VideoController.php @@ -55,7 +55,7 @@ class VideoController extends Controller $request->validate([ 'title' => 'required|string|max:255', 'description' => 'nullable|string', - 'video' => 'required|file|mimes:mp4,webm,ogg,mov,avi,wmv,flv,mkv|max:2000000', + 'video' => 'required|file|mimes:mp4,webm,ogg,mov,avi,wmv,flv,mkv|max:512000', 'thumbnail' => 'nullable|image|mimes:jpg,jpeg,png,webp|max:5120', 'visibility' => 'nullable|in:public,unlisted,private', ]); diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 8720ba4..4099dea 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -4,6 +4,9 @@ @yield('title', 'TAKEONE') + + @stack('head') + @endsection @section('content') -
+
-
@@ -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'); }); } }