Skip to main content
warpigs666
Inspiring
July 14, 2019
Question

How to make video using playsinline for iPhone?

  • July 14, 2019
  • 8 replies
  • 4090 views

Hi. I'm just learning coding, but I see here that in order to prevent a video from automatically playing in quicktime on an iPhone you have to add

<video playsinline>

New <video> Policies for iOS | WebKit

Where do I add this in Animate?

Thanks!

    This topic has been closed for replies.

    8 replies

    boyjim
    Participating Frequently
    September 23, 2021

    hi

    After 2 weeks of searching I found no response anywhere suggesting exactly where to add this - I finally (by trial and error) found a solution. I included - $('#myVideo').attr('playsinline',''); 

     

    Here's where I placed it - on the click handler for the play video button:

    function fl_MouseClickHandler()
    {
    $('#myVideo').attr('playsinline',''); 
    $("#myVideo")[0].play();
    }
    It works inline on my ios phone now, I hope that helps you 'warpigs666'
    sharonl75871280
    Participant
    January 19, 2022

    Hey BoyJim, I am trying to get the your snippit to work with some of my code and I cxan't get it to work. 

    I have pasted what I have below, is there anything you can see that I am missing, with the code in place the animation will not load at all.

     

    Thanks

     

    var _this = this;
    _this.quarryingBtn.on('click'function fl_MouseClickHandler()
    {
    $('#quarryingVideo').attr('playsinline',''); 
    $("#quarryingVideo")[0].play();
    _this.gotoAndPlay('page1');

     

    boyjim
    Participating Frequently
    January 19, 2022

    hi

    I sort of abandoned using Animate for my project and re did it entirely in Javascript, I will try and locate my earlier attempts on a back up drive that i may have kept. I apologize. I do remember however that i added that snippet directly on the main timeline. The only indication i have that mine worked is that it was an isolated MouseClickHandler event 'function fl_MouseClickHandler()'.  Yours has a variable and a specific button 'quarryubgBtn' that the click is attached to. Maybe just keep the 'video' events seperate from the btn somehow. Sorry if that doesn't help. I'm really not any more qualified to guess what else it could be.

    warpigs666
    Inspiring
    July 25, 2019

    Adobe help plssss

    warpigs666
    Inspiring
    July 23, 2019

    Can ANYONE offer advice as to how to attach the playsinline attribute to and HTML video tag in files published from Animate? Nothing I try works. It's really the determining factor in whether or not I use Animate for most of my projects. We have a workflow that requires this.

    warpigs666
    Inspiring
    July 21, 2019

    Bumping this again hoping someone sees it. I've tried posting at stackoverflow and I can't get an answer from anyone. Which is weird because it seems like iOS has been allowing playsinline to play videos in the browser for a long time now. I can't get it to work but maybe I'm just not adding the code at the right place? I opened up the html files that Animate published but I'm not sure where to add the code.

    warpigs666
    Inspiring
    July 19, 2019

    And bump again...here's hoping...

    warpigs666
    Inspiring
    July 18, 2019

    bump?

    kglad
    Community Expert
    Community Expert
    July 14, 2019

    if you're using the video component just assign the src and don't execute a play().  eg,

    $("#video_component_name")[0].src = videoURL;

    if you wanted it to play automatically,

    $("#video_component_name")[0].src = videoURL;

    $("#video_component_name")[0].play();

    warpigs666
    Inspiring
    July 14, 2019

    Sorry I meant I don’t want it to play in iPhone‘s native player, I want it to play on the page where it’s at. But not open the player, so you see what I mean?

    kglad
    Community Expert
    Community Expert
    July 14, 2019

    are you creating an air or html5/canvas project?

    warpigs666
    Inspiring
    July 14, 2019

    Should I post this in the dreamweaver forum?