Results 1 to 4 of 4

Thread: HTML5 App Back Button Behavior

  1. #1

    Default HTML5 App Back Button Behavior

    Hi,
    I'm working on my first Boxee application. It's just a front-end to a web application I'm building, so I've made it an HTML5 app.

    For the most part, it's working exactly as I'd like except I'm getting weird behavior from the bottom button on the boxee remote that should navigate backwards.

    The app starts on a landing page, where the user can then select an item, which links to another page.

    Within that second-level navigation, I'm dynamically changing out the contents of a div multiple times using something like jQuery('#mydiv').html('<my media content>').

    Strange thing is, on the first item, the back button behaves as expected - it returns to the landing page. However, on subsequent items, the back button does not return to the landing page until pressed a number of times equal to the number of items that have been played (number of times the div has been replaced with new content in the DOM).

    I could see how this might be desired behavior if you were using ajax for navigation, but since I'm not is there a way to turn it off? Or is there an event that is called when the button is pushed in browser mode that I can intercept and override the behavior?

    Also will be looking for alpha testers soon - PM me if interested. Without giving up too many details, it's essentially "Watch Later" on steroids.

    Thank in advance for any advice...

    Jesse

  2. #2

    Default

    Sorry jesse, html5 development is brand new on boxee platform and you could consider yourself a pioneer on this. I have no answer for you. But you could ask team boxee directly for an answer. I think there are not many devs here that have developed with html5 instead of the native boxee app coding.

    Good luck anyway!
    Last edited by bartsidee; September 6th, 2011 at 07:41 AM.
    Have a look at my repo at www.bartsidee.nl

  3. #3

    Default

    Well, thanks for the response anyway.

    I thought I had something using:

    Code:
    boxee.execute('browser.navigate("my-url");');
    On the window unload event... This seemed to work once, but then reverted to the previous behavior.

    Looking at the other big HTML5 apps (Netflix, Youtube) and how they use the back button, I'm guessing this is not how they expect you to navigate through the app. It does seem a lot more intuitive to me (and consistent with native apps) though.

    I might try that code onbeforeunload before giving up and either going with AJAX navigation (like the other HTML5 apps) or try to build this as an XML/python app.

  4. #4

    Default

    So just in case anyone else encounters the same problem, it seems this issue is related to how you insert iframes into the page, and is not specific to the Boxee browser.

    In my case, it's related to how the Youtube iframe Javascript API inserts the player into the page.

    Here is some detail:
    http://nirlevy.blogspot.com/2007/09/...-changing.html

    Adapted from the above, I'm using my own code to insert the iframes rather than using the Youtube Player API and everything is hunky-dory on Boxee.

    Jesse
    Last edited by jtolj; September 8th, 2011 at 02:21 PM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •