0
votes

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

1

1 Answers

0
votes

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.