diff --git a/app/Http/Controllers/Admin/ClipController.php b/app/Http/Controllers/Admin/ClipController.php index 2236fc9..00e5b3a 100644 --- a/app/Http/Controllers/Admin/ClipController.php +++ b/app/Http/Controllers/Admin/ClipController.php @@ -88,6 +88,9 @@ class ClipController extends XController config('app.media.watermark_size'), Unit::Percent, Fit::Contain, config('app.media.watermark_opacity')); } + if (!file_exists(storage_path() . '/app/public/cover')){ + mkdir(storage_path() . '/app/public/cover/'); + } $i->save(storage_path() . '/app/public/cover/optimized-'. $clip->$key); } diff --git a/app/Http/Controllers/ClientController.php b/app/Http/Controllers/ClientController.php index 35e42d4..cdb23ae 100644 --- a/app/Http/Controllers/ClientController.php +++ b/app/Http/Controllers/ClientController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers; use App\Models\Attachment; use App\Models\Category; +use App\Models\Clip; use App\Models\Comment; use App\Models\Customer; use App\Models\Gallery; @@ -44,6 +45,18 @@ class ClientController extends Controller return view('client.post', compact('area', 'post', 'title', 'subtitle')); } + public function clip(Clip $clip) + { + + if ($clip->status = 0 && !auth()->check()) { + return abort(403); + } + $area = 'clip'; + $title = $clip->title; + $subtitle = ''; + return view('client.default-list', compact('area', 'clip', 'title', 'subtitle')); + } + public function gallery(Gallery $gallery) { if ($gallery->status = 0 && !auth()->check()) { @@ -85,6 +98,15 @@ class ClientController extends Controller ->orderByDesc('id')->paginate($this->paginate); return view('client.default-list', compact('area', 'galleries', 'title', 'subtitle')); } + public function clips() + { + $area = 'clips-list'; + $title = __("Video clips list"); + $subtitle = ''; + $clips = Clip::where('status', 1) + ->orderByDesc('id')->paginate($this->paginate); + return view('client.default-list', compact('area', 'clips', 'title', 'subtitle')); + } public function attachments() { @@ -167,6 +189,9 @@ class ClientController extends Controller public function product(Product $product) { + if ($product->status = 0 && !auth()->check()) { + return abort(403); + } $area = 'product'; $title = $product->name; $subtitle = $product->excerpt; // WIP SEO diff --git a/app/Http/Requests/ClipSaveRequest.php b/app/Http/Requests/ClipSaveRequest.php index 0a8f5b9..e979cc0 100644 --- a/app/Http/Requests/ClipSaveRequest.php +++ b/app/Http/Requests/ClipSaveRequest.php @@ -25,7 +25,7 @@ class ClipSaveRequest extends FormRequest 'title' => ['required', 'string', 'max:255','min:5'], 'body' => ['nullable', 'string',], 'active' => ['nullable', 'boolean'], - 'clip' => ['nullable', 'mimes:mp4', 'max:'.'max:'.getMaxUploadSize()], + 'clip' => ['nullable', 'mimes:mp4', 'max:'.getMaxUploadSize()], 'cover' => ['nullable', 'image', 'mimes:jpeg,png,jpg,gif,svg', 'max:2048'], ]; } diff --git a/app/Models/Clip.php b/app/Models/Clip.php index ac86e27..ff8d8e5 100644 --- a/app/Models/Clip.php +++ b/app/Models/Clip.php @@ -22,10 +22,10 @@ class Clip extends Model public function imgUrl() { if ($this->cover == null) { - return asset('assets/upload/logo.svg');; + return asset('assets/upload/logo.svg'); } - return \Storage::url('clips/optimized-' . $this->cover); + return \Storage::url('cover/optimized-' . $this->cover); } public function imgOriginalUrl() { @@ -55,8 +55,7 @@ class Clip extends Model } public function webUrl(){ - return '#';// WIP - return route(''); + return route('client.clip',$this->slug); } diff --git a/resources/js/client-vue/mp3player.vue b/resources/js/client-vue/mp3player.vue index 7b7bf25..c369127 100644 --- a/resources/js/client-vue/mp3player.vue +++ b/resources/js/client-vue/mp3player.vue @@ -64,14 +64,14 @@ export default { } }, mounted() { - // window.addEventListener('load',()=>{ + window.addEventListener('load',()=>{ setTimeout(() => { this.link = this.asset; }, 500); setInterval(() => { this.updatePlayer(); }, 300); - // }); + }); }, computed: { diff --git a/resources/js/client-vue/videoPlayer.vue b/resources/js/client-vue/videoPlayer.vue index 256d261..d8a7c01 100644 --- a/resources/js/client-vue/videoPlayer.vue +++ b/resources/js/client-vue/videoPlayer.vue @@ -1,6 +1,6 @@