Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 400 and 401]

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