Skip navigation
Currently Being Moderated

Play audio using HTML under HTML Resources

Oct 24, 2011 8:21 AM

Tags: #cs5 #audio #dps #button #html5 #embedding_audio

Hello:

 

I have created a HTML5 page that loads an audio and autoplays it. The code is shown below:

 

<audio src="horse.mp3" type="audio/mp3" autoplay preload="auto" /> </audio>

 

When I test it on Safari or Firefox, it does perform well, but when I compress it on the HTMLResources.zip file as required to be included on DPS, upload it, and then I call the HTML page using a button from the Overlay Creator, it doesn't play on the iPad, nor in the Desktop Viewer

 

Is something wrong about including these files on the DPS? Is DPS web browsing HTML5 fully-compatible?

 

Saludos,

Leo

 
Replies
  • Currently Being Moderated
    Oct 24, 2011 10:15 AM   in reply to Leo Cortes

    Maybe it has to do with these customer-oriented restrictions of WebKit

    (see the second heading about "User Control")

     

    http://developer.apple.com/library/safari/#documentation/AudioVideo/Co nceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device- SpecificConsiderations.html

     
    |
    Mark as:
  • Bob Bringhurst
    4,643 posts
    May 29, 2007
    Currently Being Moderated
    Oct 24, 2011 12:28 PM   in reply to Peter Villevoye

    Another possibility is the way you're linking to the video file. If the audio file is in the root level of your HTMLResources.zip file, try using "<audio src="../HTMLResources/horse.mp3" type="audio/mp3" autoplay preload="auto" /> </audio>."

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 24, 2011 1:29 PM   in reply to Leo Cortes

    My reply was not a suggestion but a reason why it won't work.

     

    Try not setting the MP3 to autoplay, but for the test's purpose,

    try putting it first in an HTML page into a Folio in a simple way.

    Can you play it ? Then it must be the iOS-autoplay restriction.

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 24, 2011 2:15 PM   in reply to Leo Cortes

    You could try setting the button to open the HTML page in question in the Device Browser.

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 24, 2011 4:32 PM   in reply to Leo Cortes

    The reasoning behind Apple's restriction, is that they fear that users might end up with unexpected huge data bills, when a webpage initiates the download of a movie or song automatically. I can understand this policy, but the again, the WebKit might be made a little bit more intelligent, to discover which media are initiated from what source and which network. Using local media or WiFi shouldn't be a problem.

     
    |
    Mark as:
  • Casey Jensen
    293 posts
    May 4, 2011
    Currently Being Moderated
    Oct 25, 2011 5:42 AM   in reply to Leo Cortes

    There is not a known solution for this, at least that I'm aware of. Just as Peter has said, Apple has specifically disabled this for a reason. There was a way around it in earlier versions of iOS4, such that you could use an onload or simulate a click, but that workaround has been disabled by Apple.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 14, 2012 1:47 PM   in reply to Leo Cortes

    It looks like there is a way for adobe to allow media to play on html articles without requiring human interaction... if they are using a UIWebView (which is likely), there is a setting they can set that allows media to play without requiring user interaction, it would be a great feature to allow this, or at least make it a setting we can set somewhere.

    They need to set the mediaPlaybackRequiresUserAction property to NO on the UIWebView (it defaults to YES).

    Here's a link to the documentation on this feature: https://developer.apple.com/library/ios/#documentation/UIKit/Reference /UIWebView_Class/Reference/Reference.html#//apple_ref/occ/instp/UIWebV iew/mediaPlaybackRequiresUserAction

     

    Phone Gap and other products that aid the creation of HTML based Apps use this technique... any ideas on the best channel to get Adobe to implement it quickly?

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 14, 2012 2:22 PM   in reply to Max ®

    This setting is supervised by the availibility of a WiFi network. When there's just a mobile connection available through cellular networks, the allowance can be overruled, and autoplay (without interaction) will be prohibited. My guess is that Apple will even reject your app when they come across this bevavior while reviewing it. Though I must say I have seen some apps showing online video when on paid, low-speed mobile connections. Maybe the amount of traffic also counts ?

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 14, 2012 5:11 PM   in reply to Leo Cortes

    My main use case is for playing audio from html resources bundled with the folio, so wouldn't require network data usage.  Don't see why apple would reject it, its an acceptable behavior for regular InDesign articles...

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 11, 2012 2:10 AM   in reply to Bob Bringhurst

    Hi Bob, I have a similar problem. I have a HTML overlay embeded with in an indesign page, the HTML has buttons that load an audio file as well as run a CSS animation. Up until about 1 week ago the interactivity worked fine in adobe content viewer and folio builder.

     

    However now , when viewed in Adobe Content Viewer, no audio loads / no sound is heard.

     

    Why would this be? Has Content Viewer been updated recently or something and what work around is there as it definately used to work.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points