Youtube Iframe API not playing video second time on mobile devices - youtube-api

We' ve created web site with Youtube Iframe API . On the copmuter everything is playing OK, but we have problem with mobile devices. The video plays just one time. When you push the play button again it doesn't work.
We checked everything and decided that there is problem with youtube player.
I would very grateful for any solving this problem!
p.s. Devices are: Android, IOS (Phones and Tablets), browsers are Chrome and Safari

I've been having the same issue on Safari on iOS 8 -- videos will not replay after they play through to the end. Right now, I have a temporary fix in place: when you detect a state change to YT.PlayerState.ENDED (0 = ended), call seekTo(0) and then pauseVideo() on the player.

Related

How youtube is preventing browser to sleep on iPhone?

Environments
iOS 14.4.2 (safari)
chrome 91.4472.80
As I was trying to find a way to prevent my iPhone going to sleep while a browser page is opened, I found 3 ways.
use Screen Wake Lock API
https://developer.mozilla.org/en-US/docs/Web/API/Screen_Wake_Lock_API
call window.location.href periodically and stop it
play a video with a user interaction
For #1, this doesn't work on iPhone, should work on Android.
#2, didn't seem to work on either safari or chrome on iPhone.
#3, also didn't work (even playing a video after user interaction).
I tried https://github.com/richtr/NoSleep.js/ but didn't prevent from sleeping.
I also tried https://github.com/roldanjr/use-stay-awake and it opened a blank video in fullscreen (this maybe fixed by just adding https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#attr-playsinline)
Then, I noticed browser version of Youtube preventing my phone from sleeping while it's playing a video (I set my sleep time for 30 seconds, and it can play a 10 min video without turning itself off).
Does anyone know what kind of technics they are using to do that?

Rox Video Xamarin Forms Ios Not working

I am using Rox video plugin to play videos in Xamarin forms iOS. It plays the video perfectly however if I change device orientation or change to a different screen the video continues to play in the background. I can hear the audio continuing. When returning to the video player view I it loads a new version of the video up.
Can anyone with experience in the Rox Video plugin assist? or offer a free alternative to this plugin?
I searched the issue list of RoxXamarinVideo on github but found nothing about your problem.
I suggest you use FormsNativeVideoPlayer, it seems to have a great support on orientation changes.

Iframe youtube playbutton not triggering to play video on Touch Devices

Hello Guys (and girls) I am embedding an IFRAME of a youtube video on a website and it works perfectly on a DESKTOP VERSION.
However, when viewing it with any touch device, the play button DOESN'T trigger playing the video. The strange thing is that when you click outside the play button (on the video) it does play the video. This only occurs on touch devices and I verified and the issue is occurring across all touch devices.
This isn't a site specific issue, so you can try out embedding any Youtube video e.g:
You'll notice it plays when touching everywhere on the video EXCEPT when clicking play. If you have youtube embedded videos you'll probably having this issue as well.
Thanks for your help

autoplay html5 video with external link on mobiles

I have created a web page that auto plays a full screen background video.
On top of the video is a div that contains text & a link to an external site - this works fine in all desktop browsers.
How do i recreate the same setup to play on mobile devices - would I need to use javascript in order to achieve this?
I have spent many hours trawling google for a definitive answer and am now very confused.
Thanks in advance.
Autoplay for HTML5 video is not allowed on mobile devices such as iOS or Android. You can read this for the whys and hows on iOS.
On iPhone the video plays in the default (fullscreen) Quicktime player. So there is no real background notion (this could be accomplished in a native app where inline playback of video is allowed but not in the Safari/web browser). You would need to stick to an image I guess.
On the iPad or on Android in order to accomplish what you want you will need to bind your video tag to a touch event/button (like when a user 'touch' to enter your site), and on this event initiate the play sequence for the video (in your case the video being set to occupy the full width and height of the viewport).
Thanks

Mediaelement.js videos black screen but can hear audio on iOS

On my page I have 2 mediaelement players. One is an audio player that works fine. The other is a video player.
I'm using an mp4 for cross browser/device compatibility. It works everywhere without issue. The only issue I'm having is on iOS, the video plays, but the screen is black and I can only hear the audio. I've looked everywhere and tried different types of encoding but cannot solve this issue.
If I set iPadUseNativeControls: true, the video will work in the native player, but it appears on the screen really small and not centered, breaking the layout.
As an aside, I'm initializing the players via new MediaElementPlayer() as opposed to $().mediaelementplayer()
What is the issue here?
Having a similar issue with Android. Tested with Firefox Mobile 25, Firefox Beta 26 and Chrome 31. None which worked. Black picture but I can hear audio.
I can use the video player and watch the videos on Android; which tells me the MP4 encoding is fine.

Resources