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

sound still playing after html widget exit fullscreen

Hi,


So i got my html widget entering fullscreen and starting playing sound, but when exiting fullscreen the sound doesn't stop,

there the little arrow in topbar of iPad...


How could i stop the sound when exiting the fullscreen ??


Thanks

Posted on May 7, 2012 3:30 PM

Reply
Question marked as Best reply

Posted on May 7, 2012 3:39 PM

I suspect that's impossible. The reason is that a widget actually keeps running in the background even after it is closed. There is no event posted to a widget when that happens, so you cannot intercept closing the widget in Javascript to stop the sound.


Michi.

14 replies

May 8, 2012 1:47 AM in response to K T

The sound still play when i change page,

You're right, the widget keep running in background after closing it,

May be there a work- around with javascript, if html window still in focus or screen size, or ??


Or may be there a stop() all sound function built-in iBook ? Or in iOS itself ?


Thanks for advice

May 8, 2012 1:53 AM in response to daxx

I had similar problems with my widget when I was interested in finding out when the widget is closed, in order to save the state of the widget.


It turns out that the relevant events simply are not posted when executing the widget inside iBooks. (They are when you run the same widget in Dashboard.)


I'm afraid there is absolutely nothing that can be done about this, until Apple change the execution environment for widgets in iBooks. I'd suggest that you submit feedback about the problem.


Cheers,


Michi.

May 8, 2012 11:29 AM in response to MichiHenning

i think solution is with the file i find :


so i finaly get this famous file mentioned in : http://support.apple.com/kb/HT5068 ,

Apple provide a tutor without providing the file to achieve it.., did you said amateurish ?


So, i find it decompiling the iBooks.app,

go on your iTunes/Mobile Applications/ Folder,

duplicate the iBooks.ipa,and rename it with .zip extension and decompress the archive,

in iBooks Folder, open Payload folder and right-click on iBooks app to show package content,

you'll find an AppleWidgetController.js file,

despite the name, this is the AppleWidget.js mentioned in tutor because inside there the function i need (and others really interesting)


--


* notifyContentExited

* Notifies native widget controller that js widget is closing down.

* Called when the user ends the slideshow

* ------------------------------------------------------------------ */

notifyContentExited : function() {

window.location = 'apb:///do?c=exited';

},



Michi.

then itshould be as is :

in main.html load :

<script type="text/javascript" src="AppleClasses/AppleWidget.js"> </script>

add in info.plist:

<key>IBNotifiesOnExit</key>
<true/>

and javascript call :

widget.notifyContentExited()


can a real developper give us a working example with that


Thanks

sound still playing after html widget exit fullscreen

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