HTML5 Video autoplay disable?

Discussion in 'HTML & Website Design' started by JesseToxik, Mar 27, 2013.

  1. #1
    I have a video on my webpage embeded using the HTML5 video attribute.
    Everything works perfect except for one thing. It autoplays.

    I am planning on adding several videos to the page but I cannot have them all autoplay at once.

    Is there a way to disable autoplay in html5?
    Javascript is an option for me.

    Attached is my code.
    <video  autoplay="false" controls="controls" preload="metadata">
      <source src="video/trailer_test.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
      <source src="video/trailer_test.ogg" type='video/ogg; codecs="theora, vorbis"' />
      Sorry, your browser doesn't support embedded videos,
      but don't worry, you can <a href="video/trailer_test.ogg">download it</a>
      and watch it with your favorite video player!
    </video>
    Code (markup):
     
    JesseToxik, Mar 27, 2013 IP
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #2
    Ah, HTML 5 VIDEO -- another of the things that pisses me off about HTML 5 VIDEO (alongside the new tag being redundant to OBJECT, fracturing an industry that was finally settling on a standard, and undoing 15 years of progress)

    autoplay isn't a parameter type item, it doesn't take "false" as an option. You either say "autoplay" to have it start playing as soon as it can, or you OMIT THAT ATTRIBUTE so it doesn't.

    Controls also doesn't take a parameter... unless you're in XHTML, and there is no VIDEO in XHTML so...

    so just:
    <video controls preload="metadata">

    Is all you should have if you're going with the HTML 5 asshattery.
     
    deathshadow, Mar 27, 2013 IP
  3. creativewebmaster

    creativewebmaster Active Member

    Messages:
    654
    Likes Received:
    7
    Best Answers:
    4
    Trophy Points:
    78
    #3
    http://hoyois.github.com/safariextensions/clicktoplugin/

    To change the settings:

    1) Right click and click on the click to flash preferences
    2) Select the media player tab
    3) Select the behaviour how you want the plugin to react upon identifying HTML 5 videos by changing the Initial behaviour settings.

    Hope this helps.
     
    creativewebmaster, Mar 28, 2013 IP
  4. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #4
    @creativewebmaster -- like 99% of your other posts here, that has absolutely NOTHING to do with the OP's questions.
     
    deathshadow, Mar 28, 2013 IP