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

data-jwplayer-* URL attributes are ignored in Moodle 3.3 onwards. #6

Closed
kabalin opened this issue May 8, 2018 · 2 comments
Closed

Comments

@kabalin
Copy link
Contributor

kabalin commented May 8, 2018

As found while commenting on #5 It seems like data-jwplayer-* attributes are not retrieved properly for using in setup JSON object. e.g.
<a href="http://content.jwplatform.com/videos/3XnJSIm4-kNspJqnJ.mp4" data-jwplayer-subtitles="English: http://assets-jp.jwpsrv.com/tracks/2UEDrDhv.txt" data-jwplayer-description="some description">test subtitles</a>

is rendered as:
require(["media_jwplayer/jwplayer"], function(amd) { amd.setupPlayer({"playerid":"media_jwplayer_media_random5af1a61a44c1987","setupdata":{"playlist":[{"sources":[{"file":"https:\/\/content.jwplatform.com\/videos\/3XnJSIm4-kNspJqnJ.mp4"}],"title":"3XnJSIm4-kNspJqnJ.mp4"}],"width":400,"height":225},"logcontext":1618506,"logevents":["play","pause","complete"]}); });

@kabalin kabalin changed the title data-jwplayer-* are ignored in Moodle 3.3 onwards. data-jwplayer-* URL attributes are ignored in Moodle 3.3 onwards. May 8, 2018
@jproctor
Copy link
Contributor

The embed code is looking for $options['htmlattributes'], but $options only has keys originaltext, trusted, and embedorblank, which are created in /filter/mediaplugin/filter.php near this comment:

// NOTE: Options are not passed through from filter because the 'embed'
// code does not recognise filter options (it's a different kind of
// option-space) as it can be used in non-filter situations.

That said, I think I know how to fix it. PR forthcoming.

@kabalin
Copy link
Contributor Author

kabalin commented May 18, 2018

Great, thanks @jproctor!

jproctor added a commit to mtholyoke/moodle-media_jwplayer that referenced this issue May 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants