Closed zaynabtariq closed 11 months ago
Thank you! Should I be adding this code in the _load() method? And what lines of code should I be removing for this to work?
no, you have to write code separately it is not included in Tkinter VideoPlayer. You have to write logic separately to play and pause the video. You will not get the in-built functions of VideoPlayer, Let me know if you face any problems.
Thanks! I got the video player working. However, I'm having trouble displaying the image on top. My image keeps flickering (if that's the right word?) as the video plays. My image also need to be moving along the video (its some sort of pointer). Is there a way to fix this issue?
Hey guys, I'll try to rewrite this library to inherit from Canvas instead of label when I get time.
Are you using this repo or the steps I have given?
Because I think the steps given by me is not having any flickering issue
@PaulleDemon Thanks! Would appreciate that. @Meghansh-Maurya I am using the steps given by you. I'm guessing its because its drawing the video frame, then image, then video frame which might cause this effect.
Try canvas.image=yourimage This can work
Hi @Meghansh-Maurya, You cannot draw over window objects in Tkinter canvas. You can clone this project, then instead of inheriting from Label, inherit from Canvas, then use
canvas.create_image(x, y, anchor=NW, image=image)
to draw the video into the canvas; you may then be able to overlay other drawings.Originally posted by @PaulleDemon in https://github.com/PaulleDemon/tkVideoPlayer/issues/25#issuecomment-1457479719
Hi @PaulleDemon, I tried doing this but I keep getting an error. How do make this work? Exception in thread Thread-1: Traceback (most recent call last): File "threading.py", line 973, in _bootstrap_inner self.run() File "threading.py", line 910, in run self._target(*self._args, **self._kwargs) File "tkvideoplayer.py", line 131, in _load self._set_frame_size() File "tkvideoplayer.py", line 99, in _set_frame_size self.config(width=150, height=100, image=self.current_imgtk) File "init.py", line 1646, in configure return self._configure('configure', cnf, kw) File "init.py", line 1636, in _configure self.tk.call(_flatten((self._w, cmd)) + self._options(cnf)) _tkinter.TclError: unknown option "-image"