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 1781f0b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion source/streamio/classes/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function __construct($record = null) {
}

if ($record) {
$this->content = $record->content;
$this->content = json_decode($record->content);
}

if ($edit = optional_param('edit', null, PARAM_INT)) {
Expand Down
2 changes: 1 addition & 1 deletion source/streamio/classes/output/media_resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function export_for_template(renderer_base $output) {
$context = \context_system::instance();
$videourl = $this->video_url($output);

$content += [
$content = [
'elementid' => 'video-' . uniqid(),
'instance' => json_encode([
'vimeo_url' => $videourl,
Expand Down
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 1781f0b

Please sign in to comment.