daxx

Q: 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

Close

Q: sound still playing after html widget exit fullscreen

  • All replies
  • Helpful answers

  • by MichiHenning,Helpful

    MichiHenning MichiHenning May 7, 2012 3:39 PM in response to daxx
    Level 4 (1,350 points)
    May 7, 2012 3:39 PM in response to daxx

    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.

  • by K T,

    K T K T May 7, 2012 3:39 PM in response to daxx
    Level 7 (23,844 points)
    Publishing
    May 7, 2012 3:39 PM in response to daxx

    Does it stop when you advance to the next page?

  • by daxx,

    daxx daxx May 8, 2012 1:47 AM in response to K T
    Level 1 (0 points)
    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

  • by MichiHenning,

    MichiHenning MichiHenning May 8, 2012 1:53 AM in response to daxx
    Level 4 (1,350 points)
    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.

  • by daxx,

    daxx daxx May 8, 2012 11:29 AM in response to MichiHenning
    Level 1 (0 points)
    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

  • by miguel_sanchez,Solvedanswer

    miguel_sanchez miguel_sanchez May 8, 2012 1:05 PM in response to daxx
    Level 1 (20 points)
    May 8, 2012 1:05 PM in response to daxx

    You have to pause the audio into the "widget.pauseAudioVisual()" function. This function triggers when the user exits the widget.

     

    Explanation (in spanish) into my blog.

    Working example.

  • by MichiHenning,

    MichiHenning MichiHenning May 8, 2012 1:35 PM in response to miguel_sanchez
    Level 4 (1,350 points)
    May 8, 2012 1:35 PM in response to miguel_sanchez

    Thank you very much for that, this is really useful!

     

    It would be really nice if these things were documented somewhere by Apple…

     

    Cheers,

     

    Michi.

  • by daxx,

    daxx daxx May 9, 2012 3:21 AM in response to MichiHenning
    Level 1 (0 points)
    May 9, 2012 3:21 AM in response to MichiHenning

    Thanks, muchas gracias Miguel :-)

     

    May be you can help too with my other topic to fix the flash initialisation effect :

    https://discussions.apple.com/message/18324422#18324422

     

    we need more guys like you in this forum

     

    Hasta luego

  • by miguel_sanchez,

    miguel_sanchez miguel_sanchez May 10, 2012 6:45 AM in response to daxx
    Level 1 (20 points)
    May 10, 2012 6:45 AM in response to daxx

    You're welcome.

     

    I have the same problem in my ken burns widget.

     

    But i have no the solution yet :-(

  • by daxx,

    daxx daxx May 10, 2012 3:54 PM in response to miguel_sanchez
    Level 1 (0 points)
    May 10, 2012 3:54 PM in response to miguel_sanchez

    so how to open a ticket to request Apple for this ?

     

    btw, nice ken burn widget.

  • by MichiHenning,

    MichiHenning MichiHenning May 10, 2012 3:58 PM in response to daxx
    Level 4 (1,350 points)
    May 10, 2012 3:58 PM in response to daxx

    Join the Apple Developer Program (free) and submit a bug report. I've been getting timely and constructive responses to the bugs I have submitted.

     

    Michi.

  • by daxx,

    daxx daxx May 10, 2012 4:02 PM in response to MichiHenning
    Level 1 (0 points)
    May 10, 2012 4:02 PM in response to MichiHenning

    do you got a direct link ?

    there so many options, i'm lost...

  • by K T,

    K T K T May 10, 2012 4:05 PM in response to daxx
    Level 7 (23,844 points)
    Publishing
    May 10, 2012 4:05 PM in response to daxx

    daxx wrote:

     

    do you got a direct link ?

    there so many options, i'm lost...

    Register as an Apple Developer (free)

  • by daxx,

    daxx daxx May 10, 2012 4:25 PM in response to K T
    Level 1 (0 points)
    May 10, 2012 4:25 PM in response to K T

    i was already registered....

    but on the page there top menu and left menu,

    and footer menu and so on....

     

    i finally found the tiny link to bug report in footer menu,

    https://bugreport.apple.com

     

    ok, send,

    we will see ... hope sooner than later