question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Video plays in notebook but not in JupyterLab

See original GitHub issue

When I run an example similar to what is in the ImageRecorder demo as a notebook, the video plays automatically. For example a cell containing:

video = VideoStream.from_url( "http://localhost:8000/video.mp4") video

In a Jupyter notebook runs as expected, showing the video. However in Lab it just shows the class string as output:

VideoStream(video=Video(value=b'http://localhost:8000/video.mp4"))

Is there some magic command that needs to run or some setting in Lab? I know Lab disables javascript to some degree, perhaps that has something to do with it?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
vhirthamcommented, Mar 2, 2020

For everybody who has trouble showing the widget in JupyterLab:

It is actually related to ipywidgets. What solved the problem for me was the answer from “adhg” in the following issue: https://github.com/jupyter-widgets/ipywidgets/issues/2083

I just quote it, so you don’t have to follow the link and search for it:

  1. Install nodeJS (https://nodejs.org/en/)
  2. pip install ipywidgets
  3. jupyter nbextension enable --py widgetsnbextension
  4. jupyter labextension install @jupyter-widgets/jupyterlab-manager 5 (may need to restart your lab)

For step 2, you can also use conda instead of pip. I hope that helps. Greetings

@maartenbreddels Maybe it is helpful to add this to the installation section of the documentation.

1reaction
maartenbreddelscommented, Oct 16, 2019
Error creating view for mediastream: Failed to execute 'captureStream' on 'HTMLMediaElement': Cannot capture from element with cross-origin data

If this is the case, than we can’t solve that. There are security issues with this, and actually ipywebrtc development led to security improvements in chrome that may be the cause of this.

Basically, why this is not allowed is the following. If I give you a html page, with a link to a video you can only access (your private videos somewhere in the cloud), there are ‘private pixels’ on the page. These private pixels should not be allowed to be read by any javascript on that page, because I could send those to my private server and steal your video. Before, chrome actually allowed too much, and Firefox was too strict. Is this maybe Firefox?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Display Video on JupyterLab Notebook on GCP - Stack Overflow
I have tried multiple ways to display a video, but it just does not play the video. The player loads but does not...
Read more >
Video streaming in the Jupyter Notebook | by Martin Renou
It uses the power of the WebRTC browser API to allow video streaming inside of the Jupyter Notebook. The API of ipywebrtc is...
Read more >
How to Use Jupyter Notebooks with Visual Studio Code (and ...
... work with Python Jupyter notebooks. We'll use the Anaconda python distribution to create and ma. ... Your browser can't play this video....
Read more >
The dreaded Jupyter * error — what it is, and how to fix it
Your browser can't play this video. Learn more. Switch camera.
Read more >
Is it possible to embed a local file (video) in the notebook
The page will ask the IPython notebook server to serve up myvideo.mp4 , which it will sometimes do but not always. Before base64...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found