-
Notifications
You must be signed in to change notification settings - Fork 958
Open
Milestone
Description
I want to make interactive videos.
This is possible with checkboxes like this:
from ipywidgets import Video, Image
from IPython.display import display
from ipywidgets import Checkbox
fileA= 'videoA.mp4'
fileB= 'videoB.mp4'
video = Video.from_file(fileB)
top_toggle = Checkbox(description='Change Video')
def video_loader(filename):
with open(filename, 'rb') as f:
video.value = f.read()
def video_change(button):
if button['new']:
video_loader(fileA)
else:
video_loader(fileB)
top_toggle.observe(video_change, names='value')
display(top_toggle)
display(video)
But I would like to change the video with the mouse cursor position. Is there a function to observe x and y positions of the courser in a "click" event?
Metadata
Metadata
Assignees
Labels
No labels