amazon-archives / web-app-starter-kit-for-fire-tv

Web App Starter Kit Examples
https://amzn.github.io/web-app-starter-kit-for-fire-tv/
Other
372 stars 161 forks source link

Remeber the video played position and resume on loading #22

Closed nidzovito closed 9 years ago

nidzovito commented 9 years ago

Hi, I am trying to build one page player and I would like to remember the current playing time of the video. And later when this player page is loading, I would like to start the video from remembered position. I implemented the code to work in other TVs like Opera Web TV and Panasonic TV but on Amazon Fire TV I couldn't work with cookie. The minute I visit the page the cookie value is empty. I can solve this issue? If not cookie what other mechanism should I use? Thanks

craigcbrunner-amazon commented 9 years ago

Hey, Cookies should definitely work, maybe your cookie is expiring? Alternatively you can use HTML5 Local storage: http://www.w3schools.com/html/html5_webstorage.asp Which should be easy to use for what you want. Let me know if this helps! Thanks, Craig

On Jul 9, 2015, at 11:27 AM, georgi-kovachev notifications@github.com<mailto:notifications@github.com> wrote:

Hi, I am trying to build one page player and I would like to remember the current playing time of the video. And later when this player page is loading, I would like to start the video from remembered position. I implemented the code to work in other TVs like Opera Web TV and Panasonic TV but on Amazon Fire TV I couldn't work with cookie. The minute I visit the page the cookie value is empty. I can solve this issue? If not cookie what other mechanism should I use? Thanks

— Reply to this email directly or view it on GitHubhttps://github.com/amzn/web-app-starter-kit-for-fire-tv/issues/22.

nidzovito commented 9 years ago

Hi, Craig. the cookie is not working. I have two questions.

  1. Can you give some sample app which cookie works? our test url is http://fire.vibrant.tv/vibrantvideo/42-agony-aunts-promo?layout=player
  2. I think amazon fire tv is working on web view on android device. If it is true, that web view supports cookie?

Thanks

Looking forward your reply

On 7/9/2015 9:29 PM, craigcbrunner-amazon wrote:

Hey, Cookies should definitely work, maybe your cookie is expiring? Alternatively you can use HTML5 Local storage: http://www.w3schools.com/html/html5_webstorage.asp Which should be easy to use for what you want. Let me know if this helps! Thanks, Craig

On Jul 9, 2015, at 11:27 AM, georgi-kovachev notifications@github.com<mailto:notifications@github.com> wrote:

Hi, I am trying to build one page player and I would like to remember the current playing time of the video. And later when this player page is loading, I would like to start the video from remembered position. I implemented the code to work in other TVs like Opera Web TV and Panasonic TV but on Amazon Fire TV I couldn't work with cookie. The minute I visit the page the cookie value is empty. I can solve this issue? If not cookie what other mechanism should I use? Thanks

— Reply to this email directly or view it on GitHubhttps://github.com/amzn/web-app-starter-kit-for-fire-tv/issues/22.

— Reply to this email directly or view it on GitHub https://github.com/amzn/web-app-starter-kit-for-fire-tv/issues/22#issuecomment-120096545.

nidzovito commented 9 years ago

I also switched to use localstorage on same url but it is still not working on TV. Can I use any kind of emulator? Thanks

russellbeattie-amazon commented 9 years ago

Hi Georgi,

Yes, the WebView on the Fire TV supports both cookies and localStorage, so something must be wrong with your code or your setup. Here's some links that you might find useful:

Getting the most out of the Web App Tester

Creating and Publishing a Cordova Hybrid Web App on the Amazon Appstore

Good luck!

-Russ

nidzovito commented 9 years ago

Hi, Russ. We are testing the url on web app tester. Is web app tester supporting cookie and localstorage?

And in my experience, when we use cookie function in webview, it doesn't generate any error but cookie is not saving details, for example webview in iOS.

Thanks

russellbeattie-amazon commented 9 years ago

Try this:

https://output.jsbin.com/yotaxidomo

https://jsbin.com/yotaxidomo/edit?html

I just loaded it up in the Web App Tester and it works as expected.

Hope that helps!

-Russ

nidzovito commented 9 years ago

it works. It will give me the clue to investigate my problem. Thanks