Message Boards Message Boards

How to embed a YouTube video in a cloud notebook

Posted 10 years ago

Hi,

I am attempting to embed a YouTube video in a cloud notebook. Wolfram says it is available in Mathematica Online in his announcement. However, I can't figure it out. Has anyone successfully done this? If so, can you give me a peek at your function calls? Thanks.

Mike

POSTED BY: Michael McCain
12 Replies
Posted 2 years ago

Many thanks. It works fine, but I am not sure to have well understood when to put a \ . Each time we have a double quote ", we need a \ before, but sometimes there is a \ when there is no " ... May be you put additional ones at each end of line ?

Thanks again

POSTED BY: Yvan Abbe

If you write

EmbeddedHTML["

then paste the embedding script, Mathematica will ask you in a pop-up to deal with this automatically, just click yes and it will be pasted in the correct format. Then add

"]
POSTED BY: Ahmed Elbanna
Posted 2 years ago

Thanks for that quick answer: If I want to embed a Vimeo video, it works fine, but not with YouTube. Here is an example coming from the Wolfram Documentation that doesn't workif I try to use it :

EmbeddedService[{"YouTube", "mBpGUPCXQhk"}]
POSTED BY: Yvan Abbe

You are right, EmbeddedService[ ] doesn't currently work with YouTube videos, and we are working to fix this.
That is why I suggest using EmbeddedHTML[ ] instead, by providing the Share -> Embed script from the YouTube video webpage. Try this

EmbeddedHTML["<iframe width=\"560\" height=\"315\" \
src=\"https://www.youtube.com/embed/mBpGUPCXQhk\" title=\"YouTube \
video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; \
clipboard-write; encrypted-media; gyroscope; picture-in-picture\" \
allowfullscreen></iframe>"]
POSTED BY: Ahmed Elbanna
Posted 2 years ago

Hi all, It seems it doesn't work anymore, at least not exactly the same way.... Would need of refreshing the procédure. Thanks

POSTED BY: Yvan Abbe

EmbeddedHTML[ ] works fine with YouTube videos. Could you please provide an example that doesn't work along with your code?

POSTED BY: Ahmed Elbanna

Additional code which implements the various YouTube web player options:

http://community.wolfram.com/groups/-/m/t/426362

POSTED BY: Arnoud Buzing
POSTED BY: Michael McCain

When I try evaluating the cell a second time... I get a blank cell in return. I am running Safari 8.0.2 on OS 10.10.1.

POSTED BY: Michael McCain
POSTED BY: Michael McCain

Hello Michael,

its very easy, normally in a webtool you use:

<iframe width="854" height="510" src="//www.youtube.com/embed/60P7717-XOQ" frameborder="0" allowfullscreen></iframe>

to do this in a webnotebook use EmbeddedHTML[]. Note: you must change the "-signs by '- signs !

EmbeddedHTML[ "<iframe width='854' height='510' src='//www.youtube.com/embed/60P7717-XOQ' frameborder='0' allowfullscreen></iframe>"]

Just to be sure. Don't use this command in a Desktop notebook because it does not work and it provides no error.

FYI... here is Stephen Wolfram's announcement: http://blog.wolfram.com/2014/09/15/launching-today-mathematica-online/

About halfway down the page it reads...

...enter image description here

POSTED BY: Michael McCain
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract