External(Kaltura) video doesn't play when block is on auto-retract

Bug #1742349 reported by albifeduni
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Unassigned
Revision history for this message
Robert Lyon (robertl-9) wrote :

The problem with Kaltura videos in automatically retracted blocks looks to be related to the external javascript from Kaltura the Mahara block fetches to render the video.

The Mahara block sets up some video information on page load
 - but when the block is auto retracted it seems the video player knows it is not 'visible' on page and so fails to load some info.

I get this error: embedPlayer.kalturaPlayerMetaData is null

We probably need to alter how we load/start the Kaltura video and do it in a more controlled way. Possibly using the info here http://player.kaltura.com/docs/index.php?path=kwidget so that we can load the video on either page load or when a button is clicked (in this case when we expand the collapsed block)

Changed in mahara:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Rob Hardy (r-hardy) wrote :

This may be related to an issue we have found with Medial Media Library.

The issue I found is that ampersands appear to always be being encoded as HTML entities when written into the page (i.e. & becomes &) - I presume this is a feature of the Smarty templating engine, as I can see the ampersands in the URLs are not encoded in the database, nor when they are assigned to the template. This doesn't cause an issue when the (iframe-based) embed code is written directly into the HTML of the page, as it is when Retract is set to "Yes" or "No".

However, when the block is set to "Automatically retract", the embed code is loaded from a jQuery function when the block header is clicked. The ampersands are encoded when this function is written into the page, but jQuery appears to be re-encoding the ampersands (so that & becomes &). This is visible once the video is loaded, by inspecting via Firefox web developer tools, and using "Edit as HTML".

At the moment, the only fix I've found for this feels a bit hacky: to use a JavaScript replace() to decode the ampersands before they are passed to the onclick handler (see attached patch).

Revision history for this message
Rob Hardy (r-hardy) wrote :

Patch for htdocs/theme/raw/plugintype/blocktype/externalvideo/templates/content.tpl

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Thank you, Rob, for the patch. We'll put it into our code review system https://reviews.mahara.org

If you'd like to be able to push any future changes to code review directly, you can find information on how to set up an account and your dev environment at https://wiki.mahara.org/wiki/Developer_Area/Contributing_Code

Cheers
Kristina

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/8775

Changed in mahara:
status: Confirmed → In Progress
milestone: none → 18.10.0
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

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

commit c511a88b57ba18bbe4021d593657c54cf6fbacf0
Author: Rob Hardy <email address hidden>
Date: Wed Apr 4 17:03:51 2018 +1200

Bug 1742349: External(Kaltura) video doesn't play when block is on auto-retract

behatnotneeded

Change-Id: I696cc21372d878616e5111f6f1a7ecf30398b557

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
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.