omid ghalandari
6 سال پیش توسط omid ghalandari مطرح شد
0 پاسخ

ارسال ویدیو با json به vue

@hesammousavi
@ali.bayat
سلام
منم ویدیو هام رو تو مسیر storage/download قرار دادم
میخوام وقتی به سینگل پیج دوره میره ویدیو رو از storage بخونه داخله videojs نمایش بده
نمیخوام ویدیو هام در دسترس همه باشه
وقتی کاربر در این دوره شرکت کرد بتونه به همه ویدیو ها دسترسی داشته باشه

$path = storage_path($section->video);

        $video = Response::make(file_get_contents($path), 200, [
            'Content-Type' => 'video/webm',
            'Content-Disposition' => 'inline; filename="'.$section->video.'"'
        ]);

        if (request()->wantsJson()) {
            return response()->json([
                'video' =>  $video
            ]);
        }

وقتی از این روش استفاده میکنم
خطا میده

exception: "InvalidArgumentException"
message: "Malformed UTF-8 characters, possibly incorrectly encoded"