I'm embedding a youtube video in one of my notebooks, and I'm not pleased with the size of the embedded video and the alignment.
I'm using
from IPython.display importYouTubeVideo
YouTubeVideo("U3iNcBtycaQ")
To embed the video, but I would like to align the video window to the center and change it's size to something bigger. How can I do that?
One more way to change the width of the Jupyter Notebook cell is by using themes. This will increase the cell width to 100%. Also you will be able to change the font and the font size.
The Plots in the Jupyter Notebook can be Centered by Using HTML CSS Code Snippet. The Code for aligning the plots at center is shown below, by using this Code Snippet all the plots can be centered in the Jupyter Notebook. Make Sure you run this Code Snippet in Code Cell, not in Markdown Cell.
from IPython.display import YouTubeVideo
YouTubeVideo('U3iNcBtycaQ', width=1024, height=576)
I found a way to do that, but it is HTML based and not Ipython based:
<div style="text-align: center">
<iframe width="420" height="315" src=http://www.youtube.com/embed/U3iNcBtycaQ frameborder="4"></iframe>
</div>
Will appreciate an answer using the Ipython APIs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With