From September, Flash will no longer be supported by Chrome. Prepare for the shift towards HTML5 by visiting our Flash to HTML5 help page

Check it out!

Autoplay

Adform offers a mobile solution that lets you autoplay MPEG Format videos on handheld devices that do not support the autoplay feature by default.

  • Limitations
    • Only MPEG-1 videos are supported so you need to convert your MP4 (H.264), WEBM, OGV or any other format to MPEG-1.
    • The video file must be fully loaded before it can begin playing.
    • There is no sound.
  • Convert to MPEG-1

    To compress video please use ffmpeg compression tool. Once ffmpeg is installed, enter the following line into command prompt:

    ffmpeg -i source.mp4 -an -f mpeg1video -vf "crop=iw-mod(iw\,2):ih-mod(ih\,2)" -b:v 150k output.mpg

    Video quality can be adjusted by changing the bitrate which is set to 150k in the line above. 

  • Setup

    Please refer to the documentation to add the video element.

    Include autoplay script in the <head> section of the banner:

    <script src="http://s1.adform.net/banners/scripts/mobile/autoplay.js"></script>

    Autoplay script supports three different load modes:

    Standard 

    <video autoplay controls>
        <source src="assets/AdformVideo_300x200.mpg" type="video/mpg">
        <source src="assets/AdformVideo_300x200.mp4" type="video/mp4">
    </video>

    This mode will always load the mpg source and will load the mp4 source only when the user clicks on the autoplaying player. The mpg source will not be loaded if the browser supports autoplaying HTML5 videos.

    Polite

    <video data-adfm-polite-autoplay="auto" preload="none">
        <source src="assets/AdformVideo_300x200.mpg" type="video/mpg">
        <source src="assets/AdformVideo_300x200.mp4" type="video/mp4">
    </video>

    This mode will always load the mpg source and will load the mp4 source only when the user clicks on the autoplaying player. The mpg source will not be loaded if the browser supports autoplaying HTML5 videos.

    Forced polite

    <video data-adfm-polite-autoplay="force" preload="none">
        <source src="assets/AdformVideo_300x200.mpg" type="video/mpg">
        <source src="assets/AdformVideo_300x200.mp4" type="video/mp4">
    </video>

    This mode will always load the mpg source and will load the mp4 source only when the user clicks on the autoplaying player, even on browsers which supports autoplaying HTML5 videos.

     

    The second source is optional and there can be many different sources, just like in a standard HTML5 Video Player. The second source will be played when the autoplay player will be clicked.

      Loop attribute is also supported, but it is optional.

     You can load the mp4 file metadata when the preload parameter is set to "metadata" - just attach your actions on the video's "loadedmetadata" event and load our autoplay script after.

     

  • Additional Information
    • The banner only starts to play when the banner is in-screen and it pauses when it is off-screen.
    • We advise not to use custom controls when using our autoplay feature.
    • When the user clicks on our autoplay banner we immediately start the native video player, so that the user can enjoy the full video experience.
    • Play and preload indicators are included by default.
    • Video events will be reported automatically for autoplay videos.
    • This feature is only used for mobile browsers without native video autoplay support.