0

Is it possible to add "video" tag to PyWebview and to autoplay? I'm using linux mint20 with python3.8.

In main.html

<video src="js/video_01.mp4" autoplay></video>

When I run python main.py I get js: Uncaught (in promise) NotSupportedError: The element has no supported sources.

  • I don't use this library but the most likely issue causing this is the file path you provided as the source for the video element can't be found, either due to it not being able to find the file or the file not being able to be sent to the page. – tygzy Nov 14 '21 at 13:42
  • @tygzy Thanks for the speedy reply. I also though the path was incorrect so I used an image tag as well, with ``. The image was found, loaded and displayed. In addition I also converted a small .mp4 file to base64 and added `src="data:video/mp4;base64, .....` and the same error applies. – Daniel van Eeden Nov 14 '21 at 13:50
  • Have you tried putting the `mp4` file in the same file as where the html page is like, like how you did with the `png` file, I'm asking this because I have looked online and can't find anything about `mp4` files not being returned. And I have often had issues with files not being found and then realising the path I provided is wrong because of them being in different folders, if putting it in the same folder does work, put it back and try adding a `/` before the `js`. – tygzy Nov 14 '21 at 14:01
  • @tygzy Yes I have and it finds the image_01.png which I also placed in the same folder as the main.html file. I've been googling and googling and could not find anything either. I also added the base64 to scr to eliminate the possible path problem altogether with `src="data:video/mp4;base64, .....` and still nothing. I'm pulling what little hair I have left out at the moment. – Daniel van Eeden Nov 14 '21 at 14:11

0 Answers0