Created
October 12, 2019 22:58
-
-
Save mathematicalmichael/7d57afa98d96754edbb7cafadd793044 to your computer and use it in GitHub Desktop.
embed youtube into jupyter notebook (add %%HTML to top of cell)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<center> | |
<iframe id="videoframe" width="560" height="315" src="" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe> | |
<script type="text/javascript"> | |
var segment_str = window.location.pathname; | |
var segment_array = segment_str.split( '/' ); | |
var last_segment = segment_array.pop(); | |
document.getElementById('videoframe').src = 'https://www.youtube.com/embed/' + last_segment; | |
</script> | |
</center> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment