# HTML5 - auto start playing video

**URL:** <https://forum.kirupa.com/t/html5-auto-start-playing-video/308954>\
**Category:** web dev\
**Created:** [May 4, 2010, 12:51am UTC](https://forum.kirupa.com/t/html5-auto-start-playing-video/308954 "2010-05-04T00:51:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NeoDreamer](https://avatars.discourse-cdn.com/v4/letter/n/ccd318/32.png) [@NeoDreamer](https://forum.kirupa.com/u/NeoDreamer)\
**Post date:** [May 4, 2010, 12:51am UTC](https://forum.kirupa.com/t/html5-auto-start-playing-video/308954/1 "2010-05-04T00:51:36Z")

</div>

I’m developing a video website for iPad. I couldn’t get the video to autoplay. I couldn’t even force it to play after it loaded. The following code is written with the Prototype framework, but I can assure you, it doesn’t even work with straight up JS.

```php

$('container').appendChild(
    new Element(
        'video', {
            id: 'iPadVideo',
            src: 'http://site.com/live.m3u8',
            controls: 'controls',
            autoplay: 'autoplay',
            width: '100%',
            height: '100%'
        }
    )
);

$('iPadVideo').play();

```

The only way I could get play() to work is:  
[LIST=1]  
[_]use my finger to hit the play button overlayed on the player  
[_]call $(‘iPadVideo’).pause()  
[\*]call $('iPadVideo).play()  
[/LIST]

But I really just wanted it to autoplay without the user doing anything. How do I do that?
