almondz Posted April 16, 2014 Share Posted April 16, 2014 I am trying to identify the issue in the Apple iOS that prevents sound in swiffy files being played on iPads. According to Google, "Swiffy converts Flash SWF files to HTML5, allowing you to reuse Flash content on devices without a Flash player (such as iPhones and iPads)." - https://www.google.com/doubleclick/studio/swiffy/ That is true - the file size after conversion swf-to-swiffy bloats somewhat, but the animation is OK. However, in testing swf-with-audio files that I converted to swiffy, I notice that swiffy sound plays in all my browsers (IE, FF, Chrome) on a Windows machine, but on an IPad, using Safari and Chrome, the files are dead silent. It's a mystery why Google hasn't figured out a way of having swiffy deliver sound on iPads through Chrome. So is the problem Apple's iOS, and why? I imagine there's no hack that will solve the problem, but insights are appreciated. Quote Link to comment Share on other sites More sharing options...
alex_h Posted April 17, 2014 Share Posted April 17, 2014 I would guess it will be down to which format swiffy converts them too. Have a look to check the file extension and make sure it is a supported audio file format for your target device. Quote Link to comment Share on other sites More sharing options...
almondz Posted April 23, 2014 Author Share Posted April 23, 2014 Google's explanation:"Swiffy converts a SWF file to an HTML page that contains an efficient representation of the file as a JSON object. The HTML page uses the Swiffy runtime (a JavaScript library) to render the animation using mainly SVG. Compiled ActionScript code is also contained in the JSON file and executed as JavaScript in the browser." In the code of a swiffy.html file, I see "data:audio/mpeg;base64", indicating that the sound is mpeg encoded in base64. I tried decoding the base64 code, and saving as mpeg, but it didn't play. But at least it looks like the audio is mpeg. If mpeg and mp4 are the same thing(?), why the audio problem on iPads? Quote Link to comment Share on other sites More sharing options...
almondz Posted April 24, 2014 Author Share Posted April 24, 2014 Looks like iPads don't (or didn't) load sound by default:http://buildingwebapps.blogspot.it/2012/04/state-of-html5-audio-in-mobile-safari.html Quote Link to comment Share on other sites More sharing options...
alex_h Posted April 25, 2014 Share Posted April 25, 2014 Oh yeah, forgot that in mobile safari you have to activate sound from a user interaction, ie a touch. That's probably the cause of what you are seeing. Quote Link to comment Share on other sites More sharing options...
ifritgames Posted April 28, 2014 Share Posted April 28, 2014 Apple went with the decision to only play media files in a HTML5 application after the user explicitely clicked on a "play button" what can be any kind of user interaction really. Its not restricted to audio only, but this is usually what game devs recognize first. They back their decision with the idea of several users using these applications via a mobile, payed network, and as media files are usually the biggest chunk of a html or other web app, downloading them without an explicit request from the user would incur hidden costs on their mobile account. With HTML5 getting stronger and stronger these days we can hope that there will be a solution to this problem. Quote Link to comment Share on other sites More sharing options...
almondz Posted April 28, 2014 Author Share Posted April 28, 2014 That's interesting. In swiffy files, the sound is embedded in the html, e.g.:www.casedasole.it/testing/test3.html view source -> "data:audio/mpeg;base64... ","format":"MP3"So, the user has already downloaded all the sound. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.