Skip to content

Commit

Permalink
MED-100: Fix Video Time resource url
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Thies committed May 17, 2024
1 parent c6853b4 commit 4b9b11e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion source/videotime/classes/form/edit_resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions source/videotime/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ function mediatimesrc_videotime_pluginfile($course, $cm, $context, $filearea, $a

if (
in_array($filearea, [
'posterimage',
'videofile',
])
) {
$itemid = array_shift($args);
$contenthash = array_shift($args);

$relativepath = implode('/', $args);

Expand All @@ -59,7 +59,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;
}
Expand Down
1 change: 0 additions & 1 deletion source/vimeo/classes/output/video.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
Expand Down

0 comments on commit 4b9b11e

Please sign in to comment.