Nova Video
  • 🏁Getting Started
    • Introduction
    • Installation
    • Support Us
    • License
  • 🚀Usage
    • Basic Usage
    • Usage with Larupload
    • Notes
  • ⚙️Advanced Usage
    • Video Metadata
    • Rest API Usage (Larupload)
    • Video Field Options
      • Make
      • Store With Larupload
      • Player Mode
      • Player Type
      • Direction (dir)
      • Max Height
      • Hide Cover Uploader
    • Configuration
      • UI
        • Player
          • Type
          • Direction (dir)
          • Max Height
      • Cover Uploader
      • Player Mode
  • ⚪Other
    • Demo
Powered by GitBook
On this page
Edit on GitHub
  1. Advanced Usage
  2. Video Field Options

Player Type

playerType

PreviousPlayer ModeNextDirection (dir)

Last updated 1 year ago

Argument
Type
Required
Accepted Values

type

enum

VIDSTACK, DEFAULT

Starting from v6.0, the Video field uses the 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),
        ];
    }
}

⚙️
vidstack