I was searching for the most efficient way autoplay
a video in background.
Found these according to the latest information I was able to gather
- VVC/x266 - Versatile Video Coding: Can reduce data requirements by around 50% of the bit rate without compromising visual quality (Latest not supported by any browser)
- AV1 - AOMedia Video 1: AV1 codec is 30% more efficient than H.265 (Latest not supported by most browser)
- HEVC/x265 - High Efficiency Video Coding: x265 outperforms VP9 in bit-rate savings (Latest not supported by most browser)
- VP9 - Supported by most browser with webm format
I currently have a av1
inside mp4
container here
If you check this video on Safari
on all devices MacBook, iPhone & iPad and Firefox
on android doesn't autoplay is not supported.
On looking further AV1 browser support gave me a understanding, also HEVC browser support and VP9
(supported by all browsers)
I using svelte here
<script lang="ts">
import { MetaTags } from 'svelte-meta-tags';
import Viewport from 'svelte-viewport-info'
import vi from './assets/videofile.mp4'
import posterimg from './assets/PosterImage.png'
</script>
<main>
<video
autoplay
muted
loop
Playsinline
src={vi}
poster={posterimg}>
</video>
</main>
<style>
video
{
width: 100%;
-moz-user-select: none;
-webkit-user-select: none;
user-select: none;
pointer-events: none;
}
</style>
Video autoplay doesn't play on Safari
and Firefox
I have a couple of questions
- Is there a way to know if
autoplay
in the svelte script has failed to play the video on any browser?- Is there a way to know if video autoplay failed due to
low power mode
on apple device?