Show More
@@ -6,7 +6,7 b' from os.path import exists, isfile, splitext, abspath, join, isdir' | |||
|
6 | 6 | from os import walk, sep |
|
7 | 7 | |
|
8 | 8 | |
|
9 |
class VideoI |
|
|
9 | class VideoIFrame(object): | |
|
10 | 10 | """ |
|
11 | 11 | Generic class to embed videos in a iframe |
|
12 | 12 | """ |
@@ -24,9 +24,12 b' class VideoIframe(object):' | |||
|
24 | 24 | params = "?" + urlencode(self.params) |
|
25 | 25 | else: |
|
26 | 26 | params = "" |
|
27 |
return self.iframe |
|
|
27 | return self.iframe.format(width=self.width, | |
|
28 | height=self.height, | |
|
29 | id=self.id, | |
|
30 | params=params) | |
|
28 | 31 | |
|
29 |
class YouTubeVideo(VideoI |
|
|
32 | class YouTubeVideo(VideoIFrame): | |
|
30 | 33 | """Class for embedding a YouTube Video in an IPython session, based on its video id. |
|
31 | 34 | |
|
32 | 35 | e.g. to embed the video on this page: |
@@ -52,24 +55,24 b' class YouTubeVideo(VideoIframe):' | |||
|
52 | 55 | |
|
53 | 56 | iframe = """ |
|
54 | 57 | <iframe |
|
55 |
width=" |
|
|
56 |
height= |
|
|
57 |
src="http://www.youtube.com/embed/ |
|
|
58 | width="{width}" | |
|
59 | height={height}" | |
|
60 | src="http://www.youtube.com/embed/{id}{params}" | |
|
58 | 61 | frameborder="0" |
|
59 | 62 | allowfullscreen |
|
60 | 63 | ></iframe> |
|
61 | 64 | """ |
|
62 | 65 | |
|
63 |
class VimeoVideo(VideoI |
|
|
66 | class VimeoVideo(VideoIFrame): | |
|
64 | 67 | """ |
|
65 | 68 | Class for embedding a Vimeo video in an IPython session, based on its video id. |
|
66 | 69 | """ |
|
67 | 70 | |
|
68 | 71 | iframe = """ |
|
69 | 72 | <iframe |
|
70 |
width = " |
|
|
71 |
height = " |
|
|
72 |
src="http://player.vimeo.com/video/ |
|
|
73 | width = "{width}" | |
|
74 | height = "{height}" | |
|
75 | src="http://player.vimeo.com/video/{id}{params}" | |
|
73 | 76 | frameborder="0" |
|
74 | 77 | webkitAllowFullScreen |
|
75 | 78 | mozallowfullscreen |
General Comments 0
You need to be logged in to leave comments.
Login now