js sdk method play not working on ios - ios

i try to play a DM video on a page on clicking a custom button. It works perfectly on desktop browsers but not on ios devices.
Here is how i proceed using js sdk and jquery.
function _on_apiready(){
$custom_button.one("click", _playVideo)
}
function _playVideo(e){
player.play();
$custom_button.click(function(){player.togglePlay();})
}
var player = DM.player(dom_el,
{
video:dm_id,
params:{html:1, autoplay:0, info:0, logo:0, related:0},
events:{
apiready: _on_apiready,
timeupdate: _on_progress,
playing: _on_playing,
pause: _on_pause
}
}
);
On ios devices, the video seems to load but doesn't play. I need to press the play button of the player to start the video and then may use my custom button to togglePlay.
Doing something wrong ?
Thx

this question has been answered here already: Dailymotion embedded player on iOS devices (HTML5)
Basically, mobile devices prevent videos from being played automatically, this is why it's not playing with your code. As you say, those devices require an user interaction to first play the video.

Related

Plays video by phaser.js on iOS (safari) without fullscreen

How to play 2-3-5 videos by phaser on same time in inline mode (without fullscreen) on iOS?
How to check it?
https://phaser.io/examples/v2/video/change-source
In android / desktop video plays inline and no need click, but on iOS video plays only after click and opens that video in fullscreen
I had the same problem and I couldn't find the solution.
the native player keeps opening
video = game.add.video ('space');
video.addToWorld();
video.unlock();
video.setAttribute('playsinline');
video.play(true);
I've found solution for native videos play: https://github.com/bfred-it/iphone-inline-video
And made a solution for phaser based on it:
var video = game.add.video('some_video');
...
video.mute = true; // muted videos play inline without user interaction
video.unlock(); // manual phaser unlock http://phaser.io/docs/2.4.2/Phaser.Video.html#unlock
video.video.setAttribute('playsinline', 'playsinline'); // for inline mode
video.play(true); // play that video with loop

Youtube Iframe API not playing video second time on mobile devices

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.

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

Video will not play a second time on iOS devices

I'm not sure what the problem is. I have a video that I'd like to play in a modal dialog.
I have everything set up and working fine on all devices. The only issue that I've been unable to overcome is that the video will not play a second time on iOS devices.
http://c4sandbox.com/video/index.html is a simple demonstration of the problem that I'm having. If you close the dialog (it will auto close when the video ends) then click the 'show again' link on an iOS device, then the video player is just an empty black box.
What am I missing? This happens in Safari and Chrome, but only on iOS.
EDIT: The problem appears to be with video.js because a straight html5 video tag will play the video multiple times as expected. Unfortunately, I need the flash fallback so html5 only is not an option.
I'm having a similar issue. The way I am getting around it is using the player's dispose() method to kill the instance and re-injecting the HTML for the player and re-instantiating it.
Thanks #Victor! your solution works. Since there is no example code given, here is the code I used.
//Init
videoPlayer = _V_("video_post", {
controls:true,
preload:"auto",
autoplay:true,
}, function(){
});
after you're done with the player (e.g. closes the video dialog), dispose the player
videoPlayer.dispose();
Done. hope this helps.

Safari detect when video is done playing

I have a website with a list of videos to be played with an IOS device. When the user clicks on a direct link to the video to watch, the video opens in the video player. When the video is done playing or the user hits the ok button, it takes the user back to the video list.
I need to be able to fire an event in js when the video is done playing. It doesn't appear that mobile safari actually refreshes the page, just re-displays it. Is there any events that I can hook into to detect the end of the video?
Thanks!
It should work out to be like this (untested):
video = document.getElementById('yourid');
video.addEventListener("ended", function(e) {
video.webkitExitFullScreen()
});

Resources