diff --git a/source/videotime/classes/form/edit_resource.php b/source/videotime/classes/form/edit_resource.php index d7c69d0..be83e6a 100644 --- a/source/videotime/classes/form/edit_resource.php +++ b/source/videotime/classes/form/edit_resource.php @@ -137,11 +137,13 @@ public function definition_after_data() { if ($record) { $resource = new media_resource($record); + $videourl = $resource->video_url($OUTPUT); + $content = [ 'poster' => $resource->image_url($OUTPUT), 'elementid' => 'video-' . uniqid(), 'instance' => json_encode([ - 'vimeo_url' => $resource->video_url($OUTPUT), + 'vimeo_url' => $videourl, 'controls' => true, 'responsive' => true, 'playsinline' => false, diff --git a/source/videotime/lib.php b/source/videotime/lib.php index d9dddbb..667ef91 100644 --- a/source/videotime/lib.php +++ b/source/videotime/lib.php @@ -49,7 +49,6 @@ function mediatimesrc_videotime_pluginfile($course, $cm, $context, $filearea, $a ]) ) { $itemid = array_shift($args); - $contenthash = array_shift($args); $relativepath = implode('/', $args); @@ -59,7 +58,6 @@ function mediatimesrc_videotime_pluginfile($course, $cm, $context, $filearea, $a if ( (!$file = $fs->get_file_by_hash(sha1($fullpath))) || $file->is_directory() - || $file->get_contenthash() != $contenthash ) { return false; } diff --git a/source/vimeo/classes/output/video.php b/source/vimeo/classes/output/video.php index cf089ed..7b5a455 100644 --- a/source/vimeo/classes/output/video.php +++ b/source/vimeo/classes/output/video.php @@ -57,7 +57,6 @@ public function __construct(stdClass $content) { */ public function export_for_template(renderer_base $output) { global $DB, $USER; - $api = new \mediatimesrc_vimeo\api(); $context = \context_system::instance(); return [