PyQt5 QWebview, QWebPage will not loop html5 video - html

Running on Windows 10, but problem is in 7 and 8 as well.
The html loaded into the QWebview's QWebPage, the video uses the html 'video' tag, and parameter 'loop'.
<video preload="none" loop muted class="video-tag" poster="some_pic.jpg">
<source src="some_video.mp4" type="video/mp4">
</video>
If I visit the page on my browser, the video loops as intended.
The QWebView QWebPage will only play the video once, then fallback to a preset .jpg, and if cursor exits the movie and returns, the movie will play again.
I tried setting QWebPage:ToggleMediaLoop action, by calling:
self.page().action(QtWebKitWidgets.QWebPage.ToggleMediaLoop).setChecked(True)
And verified, by calling the following line before (False) and after (True):
self.page().action(QtWebKitWidgets.QWebPage.ToggleMediaLoop).isChecked()
From documentation: "Toggles whether the hovered audio or video should loop on completion or not"
Am I not setting the action properly?
Am I missing a .dll?
Is "loop" not supported by QtWebKit?
Thank you! =)

Related

HTML Videos Loop & Autoplay

I’ve tried setting them to be true and changing the order in some hope it will help. So far it’s not working I’m sure the videos silent but I muted it anyway. I want it to autoplay and loop. It does neither.
<video loop autoplay muted class="VideoMain">
<source src="A.mp4" type="video/mp4">
</video>```
I don't have A.mp4, but after trying your code with another MP4 video, it seems to work fine.
<video loop autoplay muted class="VideoMain">
<source src="https://www.sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4" type="video/mp4">
</video>
Since your code is fine, the problem must be with the video file.
Ensure that your video file is not corrupt and can be accessed.
Your MP4 is not from a live stream (ie: is not a fragmented-MP4, that needs MSE to play).
Ensure the MP4 is containing H.264 video (and AAC audio, if got sound).
MP4 can sometimes have H.265 video codec. Only supported browser is Safari (Apple).
Use MediaInfo to check video details and then confirm if your browser supports that setup.
Use a Hex editor for your OS to check the video file's bytes. A working MP4 should show moov in second or third line. If not, then video is not playing because metadata is not available (needs moving from back of file to the front).
Also check that you have saved and are accessing your site through the development version. All are common mistakes we make in the heat of development.

why my html5 video begins from start whenever i try to forward it for few seconds?

I am using a laravel project and i have implemented a html5 video tag. Video starts streaming whenever i click on play button but the problem is whenever i try to forward the video player for some duration then video automatically starts from beginning.
I have also disabled all javascript and css files attached but still same problem exists and there is nothing wrong with the video as this problem does not appear on other PHP projects when i use the same video..
<video controls width="100%">
<source src="http://127.0.0.1:8000/storage/elearning/3/tutorial/62a0df6b1c38d.mp4" type="video/mp4">
</video>

How to make music autoplay and loop in background

I am currently using this and the autoplay seems to work but the loop doesn't work.
<div id="music"><embed src="Anne_Marie - 2002 [Official Video].mp3" autostart=true loop=true></div>
Also, I wanna make it like background music so the play buttons don't show up.
The loop attribute makes the audio file loop.
The autoplay attribute makes the file start playing without the user
needing to play the file.
The controls attribute shows the controls, omitting it will hide the
controls.
<audio loop autoplay>
<source src="path/to/file" type="audio/filetype">
</audio>
Audio filetype can be: .mp3, .wav, .ogg
this audio work for me:
<audio autoplay loop src="music/music.mp3"></audio>

Mp3 with audio tag does not work in safari

I am trying to use tag to play mp3 in a page. The website is based on WordPress. The audio players do not appear in safari but working others browser.
This is the page url: http://soundhealingcenter.com/love/braintests/
Here is the code I am trying to use:
<audio controls="controls">
<source src="http://soundhealingcenter.com/online/BetaA.mp3" type="audio/mpeg" />
</audio>
The audio players * do appear* in Safari, and the audio can be played back properly. It just seems that all audio is loaded simulataneously, and since each one is about 20 minutes, that takes a lot of time, also depending on connection speed. In my case, the second one finished loading first, then 4, 5, 9, 10. The others are still loading (and can't be started yet therefore).
So you might want to consider deactivating the automatic loading on page load by adding the attribute preload="none" to the audio tag, so that would be
<audio controls="controls" preload="none">
<source src="http://soundhealingcenter.com/online/BetaA.mp3" type="audio/mpeg" />
</audio>
I also faced a issue like this and by preload attr in audio tag fixed it.
Since my audio files are small, i used preload = auto. Safari will start playback only once the complete audio is downloaded.Here is my Ref:https://codepen.io/aravi-pen/pen/OxPaVb.You can Refer here for more about preload tag:https://html.com/attributes/audio-preload/
Thanks!

Latest IOS10 Autoplay Enable

Anyone does have the idea of how apply the html5 code for video and allow autoplay in Ios10 or latest? Cause seems like Ios10 do have the latest update and it couldn't allow Autoplay. Following are the tag that im using.
<video preload="auto" id="lady_vid">
<source src="vid/lady.mp4" type="video/mp4"></source>
</video>
I was able to enable autoplay by using the following code:
<video autoplay muted playsinline>
<source src="http://example.com/video.mp4">
</video>
You need autoplay to enable autoplay.
You need muted, because only videos without audio track or with disabled audio track can be autoplayed.
You need playsinline, because only inlined videos can be autoplayed. This will also cause your video to be displayed inside the page itself and not be opened in fullscreen video view.
I was only able to enable it after specifying full url to the video, e.g. http://example.com/video.mp4 (this is a fake url obviously). It was not working with relative url, such as
<source src="video.mp4">
or
<source src="folder/video.mp4">
===========
Update:
After testing video on iOS10 for a while, I've realized that iOS10 fails to play a lot of videos. It's not a codec problem: if you encode two videos with exactly the same parameters, one might play and the other one won't.
What's even more intresting, is that most videos that cannot be played on iOS10 play perfectly well on iOS9 and iOS8.
So if your video isn't playing, try opening it with iOS Safari browser via direct link - maybe it doesn't work at all on iOS10.