improve the way we fetch platform.js

Bug #1885460 reported by Cecilia Vela Gurovic
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Unassigned

Bug Description

We need platform.js for the external video blocktype.

Currently, we fetch (from cdn.embedly.com/widgets/platform.js) and load the file even if we don't have any external video blocks in the view, we only check if the blocktype is installed on the site. We do this every time we load a page.

We need to check:
- Do we need to fetch the file or could we have it as part of Mahara core?
- Is it the latest version of the file?
- We need to load the file only if the view has a video block type in it

Changed in mahara:
milestone: none → 20.10.0
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/11046

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/11046
Committed: https://git.mahara.org/mahara/mahara/commit/55a849e4dd0606a42926d848953ae1adeb80fcdc
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 55a849e4dd0606a42926d848953ae1adeb80fcdc
Author: Cecilia Vela Gurovic <email address hidden>
Date: Mon Jun 29 16:45:24 2020 +1200

Bug 1885460: load platform.js only for external video block

TODO
embedly documentation indicates to do an async load of the file
https://docs.embed.ly/docs/platformjs

check if it's worth it to allow to define async loads in the
get_instance_javascript inside the blocktype classes
for example
array(
'file' => (is_https() ? 'https:' : 'http:') . '//cdn.embedly.com/widgets/platform.js',
'async' => true,
)

we would need to also modify the get_all_blocktype_javascript function

behatnotneeded

Change-Id: I8ff3cd0b867edbce24c7b2581e6a23e88b68ff0c

Robert Lyon (robertl-9)
Changed in mahara:
status: Confirmed → Fix Released
Changed in mahara:
status: Fix Released → Fix Committed
Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.