Player that creates HTML5 <video> tag.
More...
|
| embed ($urls, $name, $width, $height, $options) |
| Generates code required to embed the player.
|
|
| get_embeddable_markers () |
| Lists keywords that must be included in a url that can be embedded with this player.
|
|
| get_rank () |
| Default rank.
|
|
| get_supported_extensions () |
| Gets the list of file extensions supported by this media player.
|
|
| is_enabled () |
|
| list_supported_urls (array $urls, array $options=array()) |
| Given a list of URLs, returns a reduced array containing only those URLs which are supported by this player.
|
|
| setup ($page) |
| Setup page requirements.
|
|
| supports ($usedextensions=[]) |
| Returns human-readable string of supported file/link types for the "Manage media players" page.
|
|
|
const | LINKPLACEHOLDER = '<!--LINKFALLBACK-->' |
| Placeholder text used to indicate where the link fallback is placed.
|
|
const | PLACEHOLDER = '<!--FALLBACK-->' |
| Placeholder text used to indicate where the fallback content is placed within a result.
|
|
|
| find_language () |
| Tries to match the current language to existing language files.
|
|
| get_name ($name, $urls) |
| Obtains suitable name for media.
|
|
| get_regex_youtube () |
| Returns regular expression used to match URLs for single youtube video.
|
|
|
static | get_start_time (string $timestr) |
| Method to convert Youtube time parameter string, which can contain human readable time intervals such as '1h5m', '1m10s', etc or a numeric seconds value.
|
|
static | pick_video_size (&$width, &$height) |
| Utility function that sets width and height to defaults if not specified as a parameter to the function (will be specified either if, (a) the calling code passed it, or (b) the URL included it).
|
|
|
array | $extensions = null |
| caches supported extensions
|
|
string | $language = 'en' |
| language file to use
|
|
array | $loadedonpage = [] |
| caches last moodle_page used to include AMD modules
|
|
array | $ogvsupportedextensions |
| Ogv.JS supported extensions.
|
|
bool | $ogvtech = false |
| Need to use Ogv.JS Tech plugin or not.
|
|
bool | $youtube = false |
| is this a youtube link
|
|
Player that creates HTML5 <video> tag.
- Copyright
- 2016 Marina Glancy
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ add_attributes()
static core_media_player_native::add_attributes |
( |
| $tag, |
|
|
| $attributes ) |
|
staticinherited |
Adds attributes to the media tags.
- Parameters
-
string | $tag | html tag which properties are extracted, for example "<video ...>....</video>" |
array | $attributes | key-value pairs of attributes to be added |
- Return values
-
◆ compare_by_rank()
static core_media_player::compare_by_rank |
( |
| ) |
|
|
staticinherited |
◆ embed()
media_videojs_plugin::embed |
( |
| $urls, |
|
|
| $name, |
|
|
| $width, |
|
|
| $height, |
|
|
| $options ) |
Generates code required to embed the player.
- Parameters
-
moodle_url[] | $urls | |
string | $name | |
int | $width | |
int | $height | |
array | $options | |
- Return values
-
Reimplemented from core_media_player.
◆ find_language()
media_videojs_plugin::find_language |
( |
| ) |
|
|
protected |
Tries to match the current language to existing language files.
Matched language is stored in $this->language
- Return values
-
string | JS code with a setting |
◆ get_attribute()
static core_media_player_native::get_attribute |
( |
| $tag, |
|
|
| $attrname, |
|
|
| $type = PARAM_RAW ) |
|
staticinherited |
Extracts a value for an attribute.
- Parameters
-
string | $tag | html tag which properties are extracted, for example "<video ...>....</video>" |
string | $attrname | name of the attribute we are looking for |
string | $type | one of PARAM_* constants to clean the attribute value |
- Return values
-
◆ get_embeddable_markers()
media_videojs_plugin::get_embeddable_markers |
( |
| ) |
|
Lists keywords that must be included in a url that can be embedded with this player.
Any such keywords should be added to the array.
For example if this player supports FLV and F4V files then it should add '.flv' and '.f4v' to the array. (The check is not case-sensitive.)
Default handling calls the get_supported_extensions function, so players only need to override this if they don't implement get_supported_extensions.
This is used to improve performance when matching links in the media filter.
- Return values
-
array | Array of keywords to add to the embeddable markers list |
Reimplemented from core_media_player.
◆ get_language_content()
static media_videojs_plugin::get_language_content |
( |
string | $lang | ) |
|
|
static |
Returns the requested language pack in the json format.
- Parameters
-
string | $lang | The language code |
- Return values
-
false|string | The read data or false on failure |
◆ get_name()
core_media_player::get_name |
( |
| $name, |
|
|
| $urls ) |
|
protectedinherited |
Obtains suitable name for media.
Uses specified name if there is one, otherwise makes one up.
- Parameters
-
string | $name | User-specified name ('' if none) |
array | $urls | Array of moodle_url used to make up name |
- Return values
-
◆ get_rank()
media_videojs_plugin::get_rank |
( |
| ) |
|
◆ get_regex_youtube()
media_videojs_plugin::get_regex_youtube |
( |
| ) |
|
|
protected |
Returns regular expression used to match URLs for single youtube video.
- Return values
-
string | PHP regular expression e.g. '~^https?://example.org/~' |
◆ get_start_time()
static media_videojs_plugin::get_start_time |
( |
string | $timestr | ) |
|
|
staticprotected |
Method to convert Youtube time parameter string, which can contain human readable time intervals such as '1h5m', '1m10s', etc or a numeric seconds value.
- Parameters
-
- Return values
-
◆ get_supported_extensions()
media_videojs_plugin::get_supported_extensions |
( |
| ) |
|
Gets the list of file extensions supported by this media player.
Note: This is only required for the default implementations of list_supported_urls(), get_embeddable_markers() and supports(). If you override these functions to determine supported URLs in some way other than by extension, then this function is not necessary.
- Return values
-
array | Array of strings (extension not including dot e.g. '.mp3') |
Reimplemented from core_media_player_native.
◆ is_enabled()
core_media_player::is_enabled |
( |
| ) |
|
|
inherited |
◆ list_supported_urls()
media_videojs_plugin::list_supported_urls |
( |
array | $urls, |
|
|
array | $options = array() ) |
Given a list of URLs, returns a reduced array containing only those URLs which are supported by this player.
(Empty if none.)
- Parameters
-
array | $urls | Array of moodle_url |
array | $options | Options (same as will be passed to embed) |
- Return values
-
Reimplemented from core_media_player_native.
◆ pick_video_size()
static media_videojs_plugin::pick_video_size |
( |
& | $width, |
|
|
& | $height ) |
|
staticprotected |
Utility function that sets width and height to defaults if not specified as a parameter to the function (will be specified either if, (a) the calling code passed it, or (b) the URL included it).
- Parameters
-
int | $width | Width passed to function (updated with final value) |
int | $height | Height passed to function (updated with final value) |
Reimplemented from core_media_player.
◆ remove_attributes()
static core_media_player_native::remove_attributes |
( |
| $tag, |
|
|
| $attrname ) |
|
staticinherited |
Removes an attribute from the media tags.
- Parameters
-
string | $tag | html tag which properties are extracted, for example "<video ...>....</video>" |
string | array | $attrname | |
- Return values
-
◆ replace_sources()
static core_media_player_native::replace_sources |
( |
| $tag, |
|
|
| $sources ) |
|
staticinherited |
Replaces all embedded <source> tags and src attribute.
- Parameters
-
string | $tag | html tag which properties are extracted, for example "<video ...>....</video>" |
string | $sources | replacement string (expected to contain <source> tags) |
- Return values
-
◆ setup()
media_videojs_plugin::setup |
( |
| $page | ) |
|
◆ supports()
media_videojs_plugin::supports |
( |
| $usedextensions = [] | ) |
|
Returns human-readable string of supported file/link types for the "Manage media players" page.
- Parameters
-
array | $usedextensions | extensions that should NOT be highlighted |
- Return values
-
Reimplemented from core_media_player.
◆ $ogvsupportedextensions
array media_videojs_plugin::$ogvsupportedextensions |
|
protected |
Initial value:= [
'.ogv',
'.webm',
'.oga',
'.ogg'
]
Ogv.JS supported extensions.
◆ LINKPLACEHOLDER
const core_media_player::LINKPLACEHOLDER = '<!--LINKFALLBACK-->' |
|
inherited |
Placeholder text used to indicate where the link fallback is placed.
No other players will apply to it but it will be converted to the link in the end (unless prevented by OPTION_NO_LINK).
The documentation for this class was generated from the following file:
- media/player/videojs/classes/plugin.php