forked from RadoslavGeorgiev/ultimate-fields
-
Notifications
You must be signed in to change notification settings - Fork 0
Video
JIX edited this page Jul 14, 2020
·
1 revision
The video field allows users to select all elements, needed for an HTML5 video tag, including:
- Multiple video files, usable for the sources of the field.
- A poster, which will can be displayed before the video is played.
The only additional settings for the video field are its output width and settings. In in the interface (the "Output Settings" tab) and in PHP, those settings expect a number in pixels. The PHP methods, used for the output size are set_output_width( $width )
and set_output_height( $height )
.
Field::create( 'video', 'header_video' )
->set_output_width( 1920 )
->set_output_height( 1080 )
Using the value in the front-end works both with get_value
and the_value
.
If you are using get_value
functions, you will receive an array, which contains two elements:
-
videos
is an array, which contains the IDs of the videos. -
poster
may be a single ID, which is used for the poster.
Using the_value
will generate a complete video
tag.
<?php the_value( 'header_video' ) ?>
Quick start
- Creating fields and using their values
- Installation
- Administration interface
- Using the PHP API
- Container Settings
Locations
- Overview & Usage
- Post Type
- Options Page
- Taxonomy
- Comment
- User
- Widget
- Shortcode
- Menu Item
- Attachment
- Customizer
Fields
- Fields
- Text
- Textarea
- WYSIWYG
- Password
- Checkbox
- Select
- Multiselect
- Image Select
- File
- Image
- Audio
- Video
- Gallery
- WP Object
- WP Objects
- Link
- Date
- DateTime
- Time
- Color
- Font
- Icon
- Map
- Embed
- Number
- Sidebar
- Complex
- Repeater
- Layout
- Section
- Tab
- Message
Features
- Adding fields to the Customizer
- Conditional Logic
- Front-End Forms
- Administration columns
- Import and Export
- REST API
- JSON Synchronization
- Yoast SEO
Ultimate Post Types
Functions and API
Tutorials