Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes

BeEmbedHtml5Helper Class Reference

HTML5 embed helper. More...

Inheritance diagram for BeEmbedHtml5Helper:
AppHelper

List of all members.

Public Member Functions

 embed (array $obj, array $options=array(), array $attributes=array())
 Embed generic video/audio object.
 embedVideo ($data, array $params=array(), array $attributes=array())
 Embed Video using video.js.
 embedAudio ($data, array $params=array(), array $attributes=array())
 Embed Audio using video.js.

Public Attributes

 $helpers = array('Html', 'BeEmbedMedia')

Protected Member Functions

 setupAttributes (array $obj, array &$attributes=array(), $type= 'video')
 Setup HTML attributes as width, height, poster, id, class, src.

Protected Attributes

 $playerIds = array()

Detailed Description

HTML5 embed helper.

Help to embed <video> and <audio> object using video.js

Definition at line 28 of file be_embed_html5.php.


Member Function Documentation

BeEmbedHtml5Helper::embed ( array $  obj,
array $  options = array(),
array $  attributes = array() 
)

Embed generic video/audio object.

You can customize video.js using `$options['params']`. All `$options['params']` will be encoded and passed as object to video.js

Parameters:
array $obj BEdita multimedia object
array $options contains configurations (used from video.js)
array $attributes HTML attributes to add to <video> or <audio> tag
Returns:
mixed string, html code of embed media, or error message

Definition at line 56 of file be_embed_html5.php.

References embedAudio(), and embedVideo().

BeEmbedHtml5Helper::embedAudio ( data,
array $  params = array(),
array $  attributes = array() 
)

Embed Audio using video.js.

If `$data` is a string it must be the audio url to embed

Parameters:
array|string $data
array $params configuration params for video.js It will be json encoded and placed in data-setup of audio tag
array $attributes HTML attributes
Returns:
string

Definition at line 215 of file be_embed_html5.php.

References setupAttributes().

Referenced by embed().

BeEmbedHtml5Helper::embedVideo ( data,
array $  params = array(),
array $  attributes = array() 
)

Embed Video using video.js.

If `$data` is a string it must be the video url to embed

Parameters:
array|string $data
array $params configuration params for video.js It will be json encoded and placed in data-setup of video tag
array $attributes HTML attributes
Returns:
string

Definition at line 178 of file be_embed_html5.php.

References setupAttributes().

Referenced by embed().

BeEmbedHtml5Helper::setupAttributes ( array $  obj,
array &$  attributes = array(),
type = 'video' 
) [protected]

Setup HTML attributes as width, height, poster, id, class, src.

If $type is video and is only set width or height then calculate the missing dimension to fit 16/9. The 'id' is set as 'video_nickname' or 'audio_nickname' if $obj['nickname'] exists else video_ or audio_ are followed by an hash If the same $obj is embed many times 'video_nickname' or 'audio_nickname' is suffixed with an hash to avoid id collision

If missing $obj['mime_type'] the $attributes['src'] is set. In this way it will be placed in `<video src="">` or `<audio src="">` and video.js will try to use it.

Parameters:
array $obj BEdita Multimedia object
array &$attributes HTML attributes
string $type the media type you want to setup
Returns:
void

Definition at line 87 of file be_embed_html5.php.

Referenced by embedAudio(), and embedVideo().


The documentation for this class was generated from the following file:
Generated on Fri Dec 11 2015 15:29:46 by Doxygen 1.7.1  BEditaBEdita 3.7 Corylus