Player Type

playerType

ArgumentTypeRequiredAccepted Values

type

enum

VIDSTACK, DEFAULT

Starting from v6.0, the Video field uses the vidstack video player as the default option for displaying videos. However, you still have the flexibility to choose the default HTML player if you prefer it. The choice is yours, and you can easily select your preferred player type to enhance your video playback experience.

<?php

namespace App\Nova;

use Illuminate\Http\Request;
use Laravel\Nova\Fields\ID;
use Mostafaznv\NovaVideo\Enums\NovaVideoPlayerType;
use Mostafaznv\NovaVideo\Video;
use App\Models\Media as MediaModel;


class Media extends Resource
{
    public static string $model = MediaModel::class;


    public function fields(Request $request): array
    {
        return [
            ID::make()->sortable(),

            Video::make(trans('Video'), 'video', 'media')
                ->playerType(NovaVideoPlayerType::DEFAULT),
        ];
    }
}

Last updated