##// END OF EJS Templates
Merge pull request #1710 from minrk/mathjaxcdn...
Merge pull request #1710 from minrk/mathjaxcdn update MathJax CDN url for https As discussed on mathjax-users, the MathJax CDN is moving. This doesn't affect mathjax from http, which just uses cdn.mathjax.org, but for SSL-certiificates the actual CDN url must be used (formerly cloudfront, now rackcdn). Also, forgo gethostbyname_ex hack, that was me solving a theoretical problem that could not officially happen. 0.12-series is unaffected, as the https-cdn hack was not backported to 0.12.1.

File last commit:

r4872:34c10438
r6746:51b84c88 merge
Show More
display.py
35 lines | 833 B | text/x-python | PythonLexer
"""Various display related classes.
Authors : MinRK
"""
class YouTubeVideo(object):
"""Class for embedding a YouTube Video in an IPython session, based on its video id.
e.g. to embed the video on this page:
http://www.youtube.com/watch?v=foo
you would do:
vid = YouTubeVideo("foo")
display(vid)
"""
def __init__(self, id, width=400, height=300):
self.id = id
self.width = width
self.height = height
def _repr_html_(self):
"""return YouTube embed iframe for this video id"""
return """
<iframe
width="%i"
height="%i"
src="http://www.youtube.com/embed/%s"
frameborder="0"
allowfullscreen
></iframe>
"""%(self.width, self.height, self.id)