I have a videojs player and using videojs-contrib-hls
element:
<video class="video-js vjs-default-skin vjs-big-play-centered" controls playsinline)
javascript:
const player = videojs(element)
player.src({
type: 'application/x-mpegURL',
src: <hls-url>
})
player.on('error', (e) => {
console.error(e)
})
player.on('loadeddata', () => {
console.log('laodeddata')
})
On desktop safari this works smoothly and everything is good. On Mobile safari I'm seeing the following issues:
playsinline
attribute but when I did that the video was not able to play on mobile safari at allThe issue here was the library fastclick: https://github.com/ftlabs/fastclick
When the user clicks the "play" button fastclick was getting in the way and the Mobile Safari engine thought the play() was not initiated by a user gesture so Safari auto-paused the video.
The same effect was happened for the full screen action.