Supporting each other

Community forums

Welcome, Guest
Username: Password: Remember me
Report any technical problems you discover and discuss solutions.
  • Page:
  • 1

TOPIC:

Cannot add parameters to embedded YouTube video 8 years 5 months ago #3811

  • curryd
  • curryd's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 15
  • Thank you received: 0
Today I wanted to make an embedded YouTube video autoplay. But when I add "?autoplay=1" to the end of the YouTube url in the embed code, it doesn't actually make it all the way through to the HTML given to the browser. Instead, I see a "?wmode-opaque" get stuck onto the end by the PHP code, and anything I've put there gets removed (more accurately, fails to get preserved).

The problem seems to be in models_html5/youtube.html, which creates an "iframe" variable with a bunch of default attributes set to 0. There's some code in the buildIframe function that would add the parameters back in if the attributes were non-zero, but there doesn't seem to be any place in the code where the attributes' initial values can ever get changed--they're not passed in via the page settings (there are no page settings for these), and they're not parsed out of the embedded YouTube URL.

Is this a bug, or is it intentional?

Please Log in or Create an account to join the conversation.

Cannot add parameters to embedded YouTube video 8 years 5 months ago #3812

  • JohnSmith
  • JohnSmith's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 397
  • Thank you received: 71
Hi David,

It was intentional yes since for accessibility reasons autoplay is considered bad practice, www.punkchip.com/autoplay-is-bad-for-all-users/

While this hasn't changed, the editor has now changed so that you shouldn't be restricted to using the youtube page model but can in fact place youtube embed code in any page that has a text edit box. This should retain any extra parameters that you add.

John

Please Log in or Create an account to join the conversation.

Cannot add parameters to embedded YouTube video 8 years 5 months ago #3813

  • curryd
  • curryd's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 15
  • Thank you received: 0
Thanks, John. In this particular case, I have a limited set of audience members and accessibility isn't an issue. But although I experienced this problem with the autoplay= parameter, it seems the same problem would crop up with any other parameter, such as rel=.

Could I put in an enhancement request that the YouTube page be updated? At the least it should be a little smarter about preserving any existing parameters on the url (by adding its own with '&' instead of '?'). A nicer (but more complex) enhancement would be user interface elements on the page to allow enabling or disabling the common YouTube parameters (autoplay, rel, etc.) and maybe displaying a warning if autoplay is enabled.

Or given what you say about the editor and text boxes, is the intention to just remove the YouTube page as no longer needed?

Thanks,
--Dave

Please Log in or Create an account to join the conversation.

Cannot add parameters to embedded YouTube video 8 years 5 months ago #3816

  • JohnSmith
  • JohnSmith's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 397
  • Thank you received: 71
Hi,

I'll add it as an issue on Github and put a link to this Forum post but I'm not sure how much of a priority it will be given now since you can do what you want in pretty much every text box on every other page now. Someone may pick it up though and fix the logic.

The Youtube page won't be removed given that we like to retain backwards compatibility with all the current LOs that are using it.

John

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Moderators: ronmjultenJohnSmith
Time to create page: 0.043 seconds
Copyright © 2024 The Xerte Project.
Xerte logo Apereo logo OSI Logo

Search