public function video(string $videoFile, array $attributes = null) : self
    {
        if ($this->validate and ! $videoFile) {
            throw new Exception("Open Graph: Invalid video URL (empty)");
        }

        if (strpos($videoFile, '://') === false and function_exists('asset')) {
            $videoFile = asset($videoFile);
        }

        if ($this->validate and ! filter_var($videoFile, FILTER_VALIDATE_URL)) {
            throw new Exception("Open Graph: Invalid video URL '{$videoFile}'");
        }

        $this->tags[] = $this->createTag('video', $videoFile);

        if ($attributes) {
            $valid = [
                'secure_url',
                'type',
                'width',
                'height',
            ];

            $tag = $this->lastTag('type');
            if ($tag and starts_with($tag->value, 'video.')) {
                $specialValid = [
                    'actor',
                    'role',
                    'director',
                    'writer',
                    'duration',
                    'release_date',
                    'tag',
                ];

                if ($tag->value == 'video.episode') {
                    $specialValid[] = 'video:series';
                }

                $valid = array_merge($valid, $specialValid);
            }

            $this->attributes('video', $attributes, $valid);
        }

        return $this;
    }
public function video(string $videoFile, array $attributes = null) : self
    {
        if ($this->validate and ! $videoFile) {
            throw new Exception("Open Graph: Invalid video URL (empty)");
        }

        if (strpos($videoFile, '://') === false and function_exists('asset')) {
            $videoFile = asset($videoFile);
        }

        if ($this->validate and ! filter_var($videoFile, FILTER_VALIDATE_URL)) {
            throw new Exception("Open Graph: Invalid video URL '{$videoFile}'");
        }

        $this->tags[] = $this->createTag('video', $videoFile);

        if ($attributes) {
            $valid = [
                'secure_url',
                'type',
                'width',
                'height',
            ];

            $tag = $this->lastTag('type');
            if ($tag and starts_with($tag->value, 'video.')) {
                $specialValid = [
                    'actor',
                    'role',
                    'director',
                    'writer',
                    'duration',
                    'release_date',
                    'tag',
                ];

                if ($tag->value == 'video.episode') {
                    $specialValid[] = 'video:series';
                }

                $valid = array_merge($valid, $specialValid);
            }

            $this->attributes('video', $attributes, $valid);
        }

        return $this;
    }
public function video ( string $ videoFile , array $ attributes = null ) : self { if ( $ this -> validate and ! $ videoFile ) { throw new Exception ( "Open Graph: Invalid video URL (empty)" ) ; } if ( strpos ( $ videoFile , '://' ) === false and function_exists ( 'asset' ) ) { $ videoFile = asset ( $ videoFile ) ; } if ( $ this -> validate and ! filter_var ( $ videoFile , FILTER_VALIDATE_URL ) ) { throw new Exception ( "Open Graph: Invalid video URL '{$videoFile}'" ) ; } $ this -> tags [ ] = $ this -> createTag ( 'video' , $ videoFile ) ; if ( $ attributes ) { $ valid = [ 'secure_url' , 'type' , 'width' , 'height' , ] ; $ tag = $ this -> lastTag ( 'type' ) ; if ( $ tag and starts_with ( $ tag -> value , 'video.' ) ) { $ specialValid = [ 'actor' , 'role' , 'director' , 'writer' , 'duration' , 'release_date' , 'tag' , ] ; if ( $ tag -> value == 'video.episode' ) { $ specialValid [ ] = 'video:series' ; } $ valid = array_merge ( $ valid , $ specialValid ) ; } $ this -> attributes ( 'video' , $ attributes , $ valid ) ; } return $ this ; }
Adds a video tag
If the URL is relative its converted to an absolute one.

@param  string     $videoFile  The URL of the video file
@param  array|null $attributes Array with additional attributes (pairs of name and value)
@return OpenGraph
Adds a video tag If the URL is relative its converted to an absolute one .