Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playback issue on Moodle Mobile App #73

Open
User8501 opened this issue Jun 26, 2024 · 3 comments
Open

Playback issue on Moodle Mobile App #73

User8501 opened this issue Jun 26, 2024 · 3 comments

Comments

@User8501
Copy link

When my client tries to play back a video on the Moodle Mobile app (latest version), they encounter the following error:
[Class "core_external\util" not found].

The URL in the settings in Video Time will not save. All videos are hosted on YouTube.

Client is using the free version of Video Time 1.8 (2024050600) on Moodle 4.0.12 (Build: 20231211)

Moodle-App-Error-Video-Time

@FundacionRomero
Copy link

Hello, we are launching an app directly with the Moodle Mobile team, and we also have that same error. We have all the videos on Vimeo, and we have already installed the latest available version 1.8.1 (VideoTime free and PRO) in our Moodle 4.1.10.
Try to contact the support channel, but they only have attention until September, that is, in more than 1 month.

@abias
Copy link
Member

abias commented Aug 6, 2024

Hi @stefanscholz ,

I encountered this issue here as well today.

Running version 2024050601 of mod_videotime (the version which is listed as compatible with Moodle 4.1 on https://moodle.org/plugins/mod_videotime/versions), I had to see that playing Vimeo videos in videotime in the Moodle Mobile App is completely broken, I got the same error message as the issue author.

Digging into the details, I saw that you obviously ported a library change by mistake from the release which targets Moodle 4.2 and upwards to the release which targets Moodle up to 4.1

This class core_external\util which is not found in the screenshot simply does not exist before Moodle 4.2, see https://github.com/moodle/moodle/blob/main/lib/upgrade.txt#L400-L404

Here's my hotfix which allowed Vimeo videos to be played again in videotime in the Mobile App:

diff --git a/classes/output/mobile.php b/classes/output/mobile.php
index 2bfe899..5d932c4 100644
--- a/classes/output/mobile.php
+++ b/classes/output/mobile.php
@@ -31,7 +31,6 @@ require_once($CFG->dirroot . '/lib/externallib.php');
 
 use context_module;
 use moodle_url;
-use core_external\util;
 
 /**
  * Mobile output class for Video Time.
@@ -68,7 +67,7 @@ class mobile {
 
         $videotime->name = format_string($videotime->name);
         list($videotime->intro, $videotime->introformat) =
-            util::format_text($videotime->intro, $videotime->introformat, $context->id, 'mod_videotime', 'intro');
+            external_format_text($videotime->intro, $videotime->introformat, $context->id, 'mod_videotime', 'intro');
 
         $url = new moodle_url('/mod/videotime/player.php', [
             'id' => $cm->id,
@@ -126,6 +125,6 @@ class mobile {
         global $DB;
 
         $service = $DB->get_record('external_services', ['shortname' => MOODLE_OFFICIAL_MOBILE_SERVICE], '*', MUST_EXIST);
-        return util::generate_token_for_current_user($service)->token;
+        return external_generate_token_for_current_user($service)->token;
     }
 }

I would be grateful if you could fix the official release for Moodle up to 4.1 likewise.

Cheers,
Alex

@stefanscholz
Copy link
Member

We have already fixed this in https://github.com/bdecentgmbh/moodle-mod_videotime/commits/VID-820/, which is supposed to be released this week. Sorry for that!

(we accidentally applied the fix which was intended only for M42+ also to M41 and below)

@abias

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants