mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-38158 core_media: Convert media players to new plugin type
AMOS BEGIN MOV [siteyoutube,core_media],[pluginname,media_youtube] MOV [siteyoutube_desc,core_media],[pluginname_help,media_youtube] MOV [sitevimeo,core_media],[pluginname,media_vimeo] MOV [sitevimeo_desc,core_media],[pluginname_help,media_vimeo] MOV [html5audio,core_media],[pluginname,media_html5audio] MOV [html5audio_desc,core_media],[pluginname_help,media_html5audio] MOV [html5video,core_media],[pluginname,media_html5video] MOV [html5video_desc,core_media],[pluginname_help,media_html5video] MOV [flashanimation,core_media],[pluginname,media_swf] MOV [flashanimation_desc,core_media],[pluginname_help,media_swf] AMOS END
This commit is contained in:
parent
3c73b26c4b
commit
fab11235d8
76 changed files with 3524 additions and 4406 deletions
|
@ -618,19 +618,19 @@ function lesson_get_media_html($lesson, $context) {
|
|||
|
||||
$extension = resourcelib_get_extension($url->out(false));
|
||||
|
||||
$mediarenderer = $PAGE->get_renderer('core', 'media');
|
||||
$mediamanager = core_media_manager::instance();
|
||||
$embedoptions = array(
|
||||
core_media::OPTION_TRUSTED => true,
|
||||
core_media::OPTION_BLOCK => true
|
||||
core_media_manager::OPTION_TRUSTED => true,
|
||||
core_media_manager::OPTION_BLOCK => true
|
||||
);
|
||||
|
||||
// find the correct type and print it out
|
||||
if (in_array($mimetype, array('image/gif','image/jpeg','image/png'))) { // It's an image
|
||||
$code = resourcelib_embed_image($url, $title);
|
||||
|
||||
} else if ($mediarenderer->can_embed_url($url, $embedoptions)) {
|
||||
} else if ($mediamanager->can_embed_url($url, $embedoptions)) {
|
||||
// Media (audio/video) file.
|
||||
$code = $mediarenderer->embed_url($url, $title, 0, 0, $embedoptions);
|
||||
$code = $mediamanager->embed_url($url, $title, 0, 0, $embedoptions);
|
||||
|
||||
} else {
|
||||
// anything else - just try object tag enlarged as much as possible
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue