Case Scenario Critical Reader - Authoring - Inserting Media and Objects - Youtube Embed Code

Home > Authoring > Inserting Media and Objects > Youtube Embed Code

When accessing Moodle, your browser will use a secure connection to the server(https), you can tell the connection is secure by looking to the left of the url, notice the Green https to the left of the URL.

youtube1

This https will affect the video embed codes of your projects by blocking whichever ones have URL's that are insecure (http).

Youtube recently updated their embed code so that the webpage determines whether the video should be http: or https:. They do this by omitting "http:" or "https:" from the video's URL. This leaves the URL with two forward slashes "//". Previewing the video locally on your computer will not work because your computer cannot determine whether the video should use http or https.

A simple workaround is to add "https:" manually to your video's embed code URL. This will allow your video to work on secure websites - like Moodle's. If you accidentally add "http:", the video's will work locally on your computer but if embedded on a secure websites (like Moodle), some browsers will block the video because they contain an insecure URL.

Take a look at the embed codes below, and pay attention to how the bold parts of them change.

This Embed code will not work locally because the browser doesn't know whether it should be http or https. Youtube Embed Code

youtubecode

This embed code will work locally but not on some browsers if viewed through a secure page - like Moodle. http Added

httpadded

This embed code will work in Moodle and Locally.

https Added

Browsers all behave differently. Below is a summary of how each browser will handle insecure embed code within a secure page.

httpsadded

Chrome

http: -- Chrome will allow you to play all videos
http://mediastreamer.doit.wisc.edu/ltde/CSCR/youtube-example/

https -- Chrome will block the insecure video "http"
https://mediastreamer.doit.wisc.edu/ltde/CSCR/youtube-example/

Firefox

http -- Firefox will display all videos
http://mediastreamer.doit.wisc.edu/ltde/CSCR/youtube-example/

http -- Firefox will block insecure video http
https://mediastreamer.doit.wisc.edu/ltde/CSCR/youtube-example/

Safari

Note: OS X Mavericks 10.9 will ask you for a certificate if trying to play insecure content within a secure page.

http -- Safari will allow you to play all videos
http://mediastreamer.doit.wisc.edu/ltde/CSCR/youtube-example/

http -- Safari will switch from https to http in order to play the video
https://mediastreamer.doit.wisc.edu/ltde/CSCR/youtube-example/




Keywords:CSCR case scenario critical reader builder inserting media and objects Youtube Embed Code   Doc ID:36088
Owner:Emmanuel C.Group:Learn@UW Madison
Created:2013-12-17 13:55 CDTUpdated:2016-03-01 10:51 CDT
Sites:DoIT Help Desk, DoIT Tech Store, Learn@UW Madison
Feedback:  0   0