Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for video streaming #3851

Open
rsokolewicz opened this issue Feb 19, 2025 · 3 comments
Open

Support for video streaming #3851

rsokolewicz opened this issue Feb 19, 2025 · 3 comments

Comments

@rsokolewicz
Copy link

Describe the bug

I would like to use marimo.video to show a livestream (e.g. from Youtube, or any other suitable platform).

I'm controlling some complicated piece of scientific control hardware, but practically speaking you can imagine being able to control the lights in a room from a marimo dashboard and see the effects live from a webcam that's placed in the same room.

Environment

Code to reproduce

No response

@rsokolewicz rsokolewicz added the bug Something isn't working label Feb 19, 2025
@rsokolewicz
Copy link
Author

also I don't know how to add the feature label to this ticket :)

@mscolnick mscolnick removed the bug Something isn't working label Feb 19, 2025
@dmadisetti
Copy link
Collaborator

So you can already do:

mo.Html('''<iframe
    width="560"
    height="315"
    src="https://www.youtube.com/embed/jfKfPfyJRdk?si=FYEzvso8WTLyhMaJ"
    title="YouTube video player"
    frameborder="0"
    allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
    referrerpolicy="strict-origin-when-cross-origin" allowfullscreen>
</iframe>''')
mo.Html('<iframe title="vimeo-player" src="https://player.vimeo.com/video/764297424" width="640" height="360" frameborder="0" allowfullscreen></iframe>')

But maybe an API for standard video locations makes sense? e.g.

mo.video("//youtu.be/jfKfPfyJRdk")
mo.video("https://vimeo.com/312414216")

@rsokolewicz
Copy link
Author

Yes, I should've been more clear on that 😄 Adding streaming support to marimo.video.

The HTML worked for me, thanks :) :) :) I also wanted it to autoplay, for that I needed to add a autoplay=1 flag to the url:

mo.Html('''<iframe
    width="560"
    height="315"
    src="https://www.youtube.com/embed/36YnV9STBqc?autoplay=1"
    title="YouTube video player"
    frameborder="0"
    allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
    referrerpolicy="strict-origin-when-cross-origin" allowfullscreen>
</iframe>''')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants