Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 401] [Versions 311 and 402] [Versions 311 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