[IPython-dev] [sage-cloud] Re: YouTube video in IPython notebook

William Stein wstein at gmail.com
Tue Jan 28 00:46:44 EST 2014


I'm cross-posting this to ipython-dev. It's about user doing

    from IPython.display import YouTubeVideo
    YouTubeVideo('YyEReiAYGlU')

and it not working when using IPython in SageMathCloud
(https://cloud.sagemath.com), which is a hosted IPython service.
See below -- the problem is that the iframe grabs the http youtube
site instead of https...

On Mon, Jan 27, 2014 at 9:32 PM, Ivica Nakić <zzivee at gmail.com> wrote:
> The code works in the local IPython notebook on my computer, and the
> versions on my computer and SMC are the same (1.1.0). So I don't see how
> that can be an upstream bug.
> The same thing happens on SMC also for IPython notebook which is run from
> the terminal.

I think Harald didn't explain himself very clearly.  IPython outputs

<iframe width="400" height="300;"
src="http://www.youtube.com/embed/YyEReiAYGlU" frameborder="0"
allowfullscreen=""></iframe>

and indeed this can't work in SMC, because SMC is served securely over
SSL.     Instead, what IPython needs to do is output

<iframe width="400" height="300;"
src="https://www.youtube.com/embed/YyEReiAYGlU" frameborder="0"
allowfullscreen=""></iframe>

In fact, I just tried changing the http to https using the Chrome
debugger, and the video then works fine.
The IPython source code has http (instead of https) hard coded, unfortunately.

William


>
> Ivica
>
>
> Dana ponedjeljak, 27. siječnja 2014. 20:47:07 UTC+1, korisnik Harald Schilly
> napisao je:
>>
>> The generated code by IPython is
>>
>> <iframe width="400" height="300""
>> src="http://www.youtube.com/embed/YyEReiAYGlU" frameborder="0"
>> allowfullscreen=""></iframe>
>>
>> ... hence it cannot work. Maybe, somebody should post that as an upstream
>> ticket (easy to fix) or search if there already exists one?
>>
>> Harald
>>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-cloud" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-cloud+unsubscribe at googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-cloud/7fe1f328-e513-46f2-99eb-2be527852391%40googlegroups.com.
>
> For more options, visit https://groups.google.com/groups/opt_out.



-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org



More information about the IPython-dev mailing list