MPFT_Video :: embed( Array / String $args, Array / String $options = uses the defaults in the player embed documentation., Boolean $get = false )
Returns:
-
String
Note: always returns the embed code regardless of whether the get parameter is true or not.
Embeds the video using appropriate embed code for the host of the video.
Allows you to specify the flashvars, params, and embed API options in an arguments parameter.
For API options relevant to Vimeo, see here.
For API options relevant to YouTube, see here.
Note: Embedding videos requires swfobject to be enqueued in your page. Please see the example for example code that you can place in your functions.php file.
Parameters:
-
An associative array or query string (compatible with wp_parse_args) which supports the following values:
- id – the ID of the embed wrapping element – defaults to “player-“.md5(video_id)
- version – the minimum flash player version required (for flash embeds). default 8
- width – default 640
- height – default 360
- params – an args array or query string with the embed flash params.
default: array( “allowScriptAccess” => “always”, “wmode” => “transparent” )
- flashvars – an args array or query string with the flashvars.
default: array()
- attr – the HTML attributes in the output object tag (flash embed)
default: array()
-
Array / String $options = uses the defaults in the player embed documentation.
An associative array or query string (compatible with wp_parse_args) with the player options for the relevant video host (see method description).
-
Whether to get the embed code only. If this is false, the code will be echoed immediately, otherwise it is returned.