See Release Notes
Long Term Support Release
Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 401 and 402] [Versions 401 and 403]
H5P player class.
Copyright: | 2019 Sara Arjona <sara@moodle.com> |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 540 lines (19 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
player:: (17 methods):
__construct()
display()
get_messages()
add_assets_to_page()
output()
get_title()
get_context()
delete_h5p()
get_export_settings()
get_cid()
get_assets()
get_filtered_parameters()
get_dependency_files()
get_resize_code()
get_embed_code()
get_embed_url()
get_export_file()
__construct(string $url, \stdClass $config, bool $preventredirect = true, string $component = '',bool $skipcapcheck = false) X-Ref |
Inits the H5P player for rendering the content. param: string $url Local URL of the H5P file to display. param: stdClass $config Configuration for H5P buttons. param: bool $preventredirect Set to true in scripts that can not redirect (CLI, RSS feeds, etc.), throws exceptions param: string $component optional moodle component to sent xAPI tracking param: bool $skipcapcheck Whether capabilities should be checked or not to get the pluginfile URL because sometimes they |
display(string $url, \stdClass $config, bool $preventredirect = true,string $component = '', bool $displayedit = false) X-Ref |
Get the encoded URL for embeding this H5P content. param: string $url Local URL of the H5P file to display. param: stdClass $config Configuration for H5P buttons. param: bool $preventredirect Set to true in scripts that can not redirect (CLI, RSS feeds, etc.), throws exceptions param: string $component optional moodle component to sent xAPI tracking param: bool $displayedit Whether the edit button should be displayed below the H5P content. return: string The embedable code to display a H5P file. |
get_messages() X-Ref |
Get the error messages stored in our H5P framework. return: stdClass with framework error messages. |
add_assets_to_page() X-Ref |
Create the H5PIntegration variable that will be included in the page. This variable is used as the main H5P config variable. |
output() X-Ref |
Outputs H5P wrapper HTML. return: string The HTML code to display this H5P content. |
get_title() X-Ref |
Get the title of the H5P content to display. return: string the title |
get_context() X-Ref |
Get the context where the .h5p file belongs. return: context The context. |
delete_h5p(\stdClass $content) X-Ref |
Delete an H5P package. param: stdClass $content The H5P package to delete. |
get_export_settings(bool $downloadenabled) X-Ref |
Export path for settings param: bool $downloadenabled Whether the option to export the H5P content is enabled. return: \moodle_url|null The URL of the exported file. |
get_cid() X-Ref |
Get the identifier for the H5P content, to be used in the arrays as index. return: string The identifier. |
get_assets() X-Ref |
Get the core H5P assets, including all core H5P JavaScript and CSS. return: Array core H5P assets. |
get_filtered_parameters() X-Ref |
Get filtered parameters, modifying them by the renderer if the theme implements the h5p_alter_filtered_parameters function. return: string Filtered parameters. |
get_dependency_files() X-Ref |
Finds library dependencies of view return: array Files that the view has dependencies to |
get_resize_code() X-Ref |
Resizing script for settings return: string The HTML code with the resize script. |
get_embed_code(string $url, bool $embedenabled) X-Ref |
Embed code for settings param: string $url The URL of the .h5p file. param: bool $embedenabled Whether the option to embed the H5P content is enabled. return: string The HTML code to reuse this H5P content in a different place. |
get_embed_url(string $url, string $component = '') X-Ref |
Get the encoded URL for embeding this H5P content. param: string $url The URL of the .h5p file. param: string $component optional Moodle component to send xAPI tracking return: \moodle_url The embed URL. |
get_export_file() X-Ref |
Return the info export file for Mobile App. return: array or null |