Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Audio in widget. Anyone had any success?

If anyone knows how to get audio working in a widget / html interactive, please post.


Something as simple as a button on a page that plays a .m4a file would be great

iBook, Mac OS X (10.7.2), iBooks Author

Posted on Jan 30, 2012 4:24 PM

Reply
41 replies

Feb 24, 2012 2:27 PM in response to auralsculpture

Try (in the main.html page of your widget):


<audio style="audio" controls="controls" autoplay="autoplay">

<source src="whoosh.m4a" />

</audio>


This works if you have got your html widget right. I tried using dashcode to create my widget, but gave up. https://github.com/TrevorBurnham/iBooks-HTML-Widget-Boilerplate will provide you with a widget template which is easy to work with.


Don't attempt to play sounds other than .m4a. Use Quick time player to convert your wav/mp3 files.


My problem is that I can play sounds in my initial page, but I am struggling with a frameset.It plays on my desktop, but not on the iPad. Help!


The support for these basic questions is pretty minimal, I have found.


Good luck!

Feb 25, 2012 1:59 PM in response to Matthew Mclean

Thanks for posting. Unfortunately it did not work for me. Loads into iBook fine and then it seems as though the timeline is moving as the play button fades out and then fades back in but there is no sound.

1) Very, very strange! I just went back and rechecked my playback on the iPad. The audio only file still plays fine. So, a grabbed my iPhone an made a quick movie of what I see and hear. Quality is not that great but you can at least hear the audio playing. I then uploaded this file (133.5 GB) so you could see what I am getting. However, since some people may not want to waste tile downloading the original movie file, I converted it to a 720p anamorphically encoded file whis is only 17.3% (23.2 MB) as large. Here are the URLs if interested in seeing the results:


Original File: IMG_0056.MOV


Recompressed File: IMG_0056.m4v


2) To what timeline are you referring? I did not include a "displayed" timeline in the widget since the current version of Hype appears to generate a widget export error on the M4A file since the is no defined display height. (Will probably contact Tumult later and see if if it is possible for them to add a separate audio "control" module to get around this widget generation problem.) In any case, that is why I used the "Button" approach for this initial "audio in widget" test. Unfortunately, I attended our local MUG meeting today and didn't test the widget before leaving and didn't take the time to correct the "Button" routine before uploading the test widget after I came home and ran a quick playback test via the iBooks Author "Preview" file.


User uploaded file

Feb 25, 2012 4:53 PM in response to asoscia

Jon- I assume you are adding the sound file to the widget after exporitng from Hype? Or am I mistaken?

You are mistaken. I add the M4A file directly to Hype. But, since Hype does not have a specific defined handler for MPEG-4 (AAC) audio, I use the "video/mp4" designation but turn off the "Controls" option since the widget exporter generates an exception if you attempt to create a play/progress bar/volume/pause control which is likely due to the fact that the audio file has an undefined display height of "zero" but a valid width if you define it in the scene window. I then add a "Button" and define the action(s) desired. Basically, I left the media autostart default set and use the button to replay the basic timeline as defined by the length of the audio file.


User uploaded file

Audio in widget. Anyone had any success?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.