Jupyter HTML5视频播放器小部件
jpy-video的Python项目详细描述
#jupyter视频小部件
本项目的目标是开发一个自定义jupyter[widget](https://github.com/ipython/ipywidgets),使通过嵌入jupyter笔记本的html5视频播放器轻松播放视频(本地和远程)。这个widget项目是使用非常方便的cookiecutter[模板](https://github.com/jupyter widgets/widget cookiecutter)初始化的。
[示例](example.png)
可以使用命令"jupyter nbextension list"查看当前启用的笔记本扩展(如果有的话)。启用它的方法如下:
``bash
jupyter nbextension enable--py--sys prefix widgetsnbextension
```
另外运行以下命令:
``bash
jupyter labextension install@jupyter widgets/jupyterlab manager
`````
``bash
pip install jupyter video widget
jupyter nbextension install--py--sys prefix jpy_video
jupyter nbextension enable--py--sys prefix jpy_video
jupyter labextension install jupyter video
````
jupyter-nbextension install--symlink--py--sys前缀jpy-video
jupyter-nbextension enable--py--sys前缀jpy-video
nbextension list
```
,如果使用jupyterlab,另外运行以下命令:
``bash
jupyter labextension install@jupyter widgets/jupyterlab manager
````
>然后从该项目的js目录运行此命令:
``bash
`jupyter labextension install.
```
代码
jupyter小部件开发使用[npm]([npm](https://docs.npmjs.com/getting-started/what-is-npm)(节点包管理器)来处理所有可怕的javascript细节。此项目的源代码位于"js"文件夹中,npm包由文件"js/package.json"定义。视频小部件的实际javascript源代码完全包含在文件'js/src/jupyter video.js'中。这是处理此项目前端部分时唯一需要编辑的javascript文件。
更改此javascript代码后,必须将其准备好并打包到项目python端的"static"文件夹中。通过在"js"文件夹中键入以下命令来执行此操作:
``bash
npm install
````
>有关更多有用信息,请参见下面的链接:
-https://docs.npmjs.com/cli/install
-http://stackoverflow.com/questions/19578796/npm安装的保存选项是什么
在python端使用,而在javascriot端使用jupyter视频。
-jupyter_video_widget/
-jpy_video/all python code lives here
-static/prepared and packated js code end up here
-version.py版本号(python端)
-video.py widget python code
-server.py包含支持字节范围请求的http文件服务器
-compound.py
-monotext_widget.py
-js/所有原始javascript代码都存在于这里
-dist/
-node\u modules/
-src/
-jupyter-video.js小部件javascript代码
-embed.js仅编辑以更新导出的模块名(例如video.js)
-index.js仅编辑以更新导出的模块名(例如video.js)
-extension.js
-readme.md
-package.js on版本号(js端)、作者姓名、电子邮件地址、github org等
-webpack.config.js包含python端静态js文件夹的路径
-setup.py
-setup.cfg
-manifest.in包含jpy_video下静态文件夹的相对路径
-requirements.txt
\reference information
-jupyter widgets文档:
-[jupyter widgets github](https://github.com/ipython/ipywidgets)
-[构建自定义小部件](https://ipywidgets.readthedocs.io/en/latest/examples/widget%20custom.html)
-[低级别小部件教程](https://ipywidgets.readthedocs.io/en/latest/examples/widget%20low%20level.html)
-有用的html5文章:
-[关于实现自定义视频的好东西HTML5播放器](https://developer.mozilla.org/en-us/apps/fundamentals/audio-and-u-video-delivery/cross-u-browser-video-player)
-[视频播放器样式](https://developer.mozilla.org/en-us/apps/fundamentals/audio-and-u-video-delivery/video-player-style-basics)
-[媒体缓冲和寻找一个显示视频加载时间范围的好例子(https://developer.mozilla.org/en-us/apps/fundamentals/audio_and_video_delivery/buffering_seeking_time_ranges)
-[HTML5媒体事件](https://www.w3.org/2010/05/video/media events.html)
-有关HTML5的更多信息视频/音频媒体:
-https://www.html5rocks.com/en/tutorials/video/basics/
-https://developer.mozilla.org/en-us/docs/web/api/htmlvideoelement
-https://developer.mozilla.org/en-us/docs/web/api/htmlmediaeelement
-https://developer.mozilla.org/en-us/docs/learn/html/multimedia-u-and-u-embedding/video-u-audio-u-content
-https://developer.mozilla.org/en-us/apps/fundamentals/audio-u-and-video-u-delivery
-https://developer.mozilla.org/en-us/apps/fundamentals/audio-u-video-manipulation
本项目的目标是开发一个自定义jupyter[widget](https://github.com/ipython/ipywidgets),使通过嵌入jupyter笔记本的html5视频播放器轻松播放视频(本地和远程)。这个widget项目是使用非常方便的cookiecutter[模板](https://github.com/jupyter widgets/widget cookiecutter)初始化的。
[示例](example.png)
可以使用命令"jupyter nbextension list"查看当前启用的笔记本扩展(如果有的话)。启用它的方法如下:
``bash
jupyter nbextension enable--py--sys prefix widgetsnbextension
```
另外运行以下命令:
``bash
jupyter labextension install@jupyter widgets/jupyterlab manager
`````
``bash
pip install jupyter video widget
jupyter nbextension install--py--sys prefix jpy_video
jupyter nbextension enable--py--sys prefix jpy_video
jupyter labextension install jupyter video
````
jupyter-nbextension install--symlink--py--sys前缀jpy-video
jupyter-nbextension enable--py--sys前缀jpy-video
nbextension list
```
,如果使用jupyterlab,另外运行以下命令:
``bash
jupyter labextension install@jupyter widgets/jupyterlab manager
````
>然后从该项目的js目录运行此命令:
``bash
`jupyter labextension install.
```
代码
jupyter小部件开发使用[npm]([npm](https://docs.npmjs.com/getting-started/what-is-npm)(节点包管理器)来处理所有可怕的javascript细节。此项目的源代码位于"js"文件夹中,npm包由文件"js/package.json"定义。视频小部件的实际javascript源代码完全包含在文件'js/src/jupyter video.js'中。这是处理此项目前端部分时唯一需要编辑的javascript文件。
更改此javascript代码后,必须将其准备好并打包到项目python端的"static"文件夹中。通过在"js"文件夹中键入以下命令来执行此操作:
``bash
npm install
````
>有关更多有用信息,请参见下面的链接:
-https://docs.npmjs.com/cli/install
-http://stackoverflow.com/questions/19578796/npm安装的保存选项是什么
在python端使用,而在javascriot端使用jupyter视频。
-jupyter_video_widget/
-jpy_video/all python code lives here
-static/prepared and packated js code end up here
-version.py版本号(python端)
-video.py widget python code
-server.py包含支持字节范围请求的http文件服务器
-compound.py
-monotext_widget.py
-js/所有原始javascript代码都存在于这里
-dist/
-node\u modules/
-src/
-jupyter-video.js小部件javascript代码
-embed.js仅编辑以更新导出的模块名(例如video.js)
-index.js仅编辑以更新导出的模块名(例如video.js)
-extension.js
-readme.md
-package.js on版本号(js端)、作者姓名、电子邮件地址、github org等
-webpack.config.js包含python端静态js文件夹的路径
-setup.py
-setup.cfg
-manifest.in包含jpy_video下静态文件夹的相对路径
-requirements.txt
\reference information
-jupyter widgets文档:
-[jupyter widgets github](https://github.com/ipython/ipywidgets)
-[构建自定义小部件](https://ipywidgets.readthedocs.io/en/latest/examples/widget%20custom.html)
-[低级别小部件教程](https://ipywidgets.readthedocs.io/en/latest/examples/widget%20low%20level.html)
-有用的html5文章:
-[关于实现自定义视频的好东西HTML5播放器](https://developer.mozilla.org/en-us/apps/fundamentals/audio-and-u-video-delivery/cross-u-browser-video-player)
-[视频播放器样式](https://developer.mozilla.org/en-us/apps/fundamentals/audio-and-u-video-delivery/video-player-style-basics)
-[媒体缓冲和寻找一个显示视频加载时间范围的好例子(https://developer.mozilla.org/en-us/apps/fundamentals/audio_and_video_delivery/buffering_seeking_time_ranges)
-[HTML5媒体事件](https://www.w3.org/2010/05/video/media events.html)
-有关HTML5的更多信息视频/音频媒体:
-https://www.html5rocks.com/en/tutorials/video/basics/
-https://developer.mozilla.org/en-us/docs/web/api/htmlvideoelement
-https://developer.mozilla.org/en-us/docs/web/api/htmlmediaeelement
-https://developer.mozilla.org/en-us/docs/learn/html/multimedia-u-and-u-embedding/video-u-audio-u-content
-https://developer.mozilla.org/en-us/apps/fundamentals/audio-u-and-video-u-delivery
-https://developer.mozilla.org/en-us/apps/fundamentals/audio-u-video-manipulation