Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]

Base class for players which return native HTML5 <video> or <audio> tags

Copyright: 2016 Marina Glancy
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 132 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

core_media_player_native:: (6 methods):
  get_attribute()
  remove_attributes()
  add_attributes()
  replace_sources()
  get_supported_extensions()
  list_supported_urls()


Class: core_media_player_native  - X-Ref

Base class for players which return native HTML5 <video> or <audio> tags

get_attribute($tag, $attrname, $type = PARAM_RAW)   X-Ref
Extracts a value for an attribute

param: string $tag html tag which properties are extracted, for example "<video ...>....</video>"
param: string $attrname name of the attribute we are looking for
param: string $type one of PARAM_* constants to clean the attribute value
return: string|null

remove_attributes($tag, $attrname)   X-Ref
Removes an attribute from the media tags

param: string $tag html tag which properties are extracted, for example "<video ...>....</video>"
param: string|array $attrname
return: string

add_attributes($tag, $attributes)   X-Ref
Adds attributes to the media tags

param: string $tag html tag which properties are extracted, for example "<video ...>....</video>"
param: array $attributes key-value pairs of attributes to be added
return: string

replace_sources($tag, $sources)   X-Ref
Replaces all embedded <source> tags and src attribute

param: string $tag html tag which properties are extracted, for example "<video ...>....</video>"
param: string $sources replacement string (expected to contain <source> tags)
return: string

get_supported_extensions()   X-Ref
No description

list_supported_urls(array $urls, array $options = array()   X-Ref
No description