← Back to team overview

mahara-contributors team mailing list archive

[Bug 1207140] Re: YouTube filter requires updates

 

Okay, that must have been why I didn't notice this. I was getting the
old embed code -- perhaps YouTube had stored this as my preference at
some point.

Re-opening. We should support the new and old embed code, by supporting
scheme-relative URLs for iframes. This will probably require us
rewriting the $cfg variable that stores the regular expression that
checks for valid iframe URLs, and/or changing how we use htmlpurifier.

** Changed in: mahara
       Status: Incomplete => In Progress

** Changed in: mahara/1.6
       Status: Incomplete => In Progress

** Changed in: mahara/1.7
       Status: Incomplete => In Progress

** Changed in: mahara/1.8
       Status: Incomplete => In Progress

** Summary changed:

- YouTube filter requires updates
+ YouTube iframe filter doesn't support the //youtube.com URLs YouTube now provides in embed code

** Description changed:

- 1. The iframe embed code for YouTube videos does not have the protocol
- included anymore thus causing problems when trying to embed the code
- into a site.
+ In response to FireFox's change in not supporting iframes with a
+ http/https protocol that doesn't match the protocol of the parent page,
+ YouTube's embed code now lists protocol-relative URLs. These start with
+ "//www.youtube.com", no "http://";. This is a standard type of relative
+ URL/URI, but our code doesn't support it.
  
- The code reads:
- <iframe width="560" height="315" src="//www.youtube.com/embed/XXXXX?rel=0" frameborder="0" allowfullscreen></iframe>
- 
- YouTube says:
- 
- ''Just using //: instead of http:// or https:// means that you would
- like to use whichever protocol the parent page is using.
- 
- So a page called http://example.com with include http://youtube.com
- and a page called https://example.com with include https://youtube.com
- 
- It's intentional.''
- 
- https://groups.google.com/a/googleproductforums.com/d/msgid/youtube
- /bce484af-b2e6-4f6e-9bc0-6c7617e08406%40googleproductforums.com
- 
- 2. When someone wants to use the YouTube URL from a mobile device, it is
- shortened to youtu.be. However, these videos can't be embedded because
- the filter doesn't understand that URL.
+ Since we already store the allowed iframe domains without a protocol in
+ front of them, we should also support these protocol-relative URLs.

** Description changed:

  In response to FireFox's change in not supporting iframes with a
  http/https protocol that doesn't match the protocol of the parent page,
  YouTube's embed code now lists protocol-relative URLs. These start with
  "//www.youtube.com", no "http://";. This is a standard type of relative
  URL/URI, but our code doesn't support it.
  
  Since we already store the allowed iframe domains without a protocol in
  front of them, we should also support these protocol-relative URLs.
+ 
+ To replicate:
+ 1. Open up a YouTube video
+ 2. Click "Share" and then "Embed"
+ 3. Make sure you have NOT ticked the "Use old embed code" box
+ 4. You should get an iframe embed code, like this: <iframe width="420" height="315" src="//www.youtube.com/embed/NkyEOrQiGMQ" frameborder="0" allowfullscreen></iframe>
+ 5. Paste this into an external media block or a text block in Mahara
+ 
+ Expected result: You should be able to view the video once you've saved the block
+ Actual result: The block will not display the video

** Description changed:

  In response to FireFox's change in not supporting iframes with a
  http/https protocol that doesn't match the protocol of the parent page,
  YouTube's embed code now lists protocol-relative URLs. These start with
  "//www.youtube.com", no "http://";. This is a standard type of relative
  URL/URI, but our code doesn't support it.
  
  Since we already store the allowed iframe domains without a protocol in
  front of them, we should also support these protocol-relative URLs.
  
  To replicate:
- 1. Open up a YouTube video
+ 1. Open up a YouTube video on youtube.com
  2. Click "Share" and then "Embed"
  3. Make sure you have NOT ticked the "Use old embed code" box
  4. You should get an iframe embed code, like this: <iframe width="420" height="315" src="//www.youtube.com/embed/NkyEOrQiGMQ" frameborder="0" allowfullscreen></iframe>
  5. Paste this into an external media block or a text block in Mahara
  
  Expected result: You should be able to view the video once you've saved the block
  Actual result: The block will not display the video

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contrib members
https://bugs.launchpad.net/bugs/1207140

Title:
  YouTube iframe filter doesn't support the //youtube.com URLs YouTube
  now provides in embed code

Status in Mahara ePortfolio:
  In Progress
Status in Mahara 1.6 series:
  In Progress
Status in Mahara 1.7 series:
  In Progress
Status in Mahara 1.8 series:
  In Progress

Bug description:
  In response to FireFox's change in not supporting iframes with a
  http/https protocol that doesn't match the protocol of the parent
  page, YouTube's embed code now lists protocol-relative URLs. These
  start with "//www.youtube.com", no "http://";. This is a standard type
  of relative URL/URI, but our code doesn't support it.

  Since we already store the allowed iframe domains without a protocol
  in front of them, we should also support these protocol-relative URLs.

  To replicate:
  1. Open up a YouTube video on youtube.com
  2. Click "Share" and then "Embed"
  3. Make sure you have NOT ticked the "Use old embed code" box
  4. You should get an iframe embed code, like this: <iframe width="420" height="315" src="//www.youtube.com/embed/NkyEOrQiGMQ" frameborder="0" allowfullscreen></iframe>
  5. Paste this into an external media block or a text block in Mahara

  Expected result: You should be able to view the video once you've saved the block
  Actual result: The block will not display the video

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1207140/+subscriptions


References