videojs / video.js

Video.js - open source HTML5 video player
https://videojs.com
Other
37.99k stars 7.44k forks source link

Issues with loadeddata and loadedmetadata events on Fire Strick web app #5397

Closed ZHAJOR closed 6 years ago

ZHAJOR commented 6 years ago

Description

Hi, I'm developing a fireTV web app using videojs. I was trying on Chrome/Firefox and the application was playing fine. Then I tried on fireTV web app tester (a bit late), and I have one big issue: when the events loadeddata or loadedmetadata are triggered, I try to get the player.duration() and player.current_time() and they are both "undefined". I also try to wait 1,3 and 5 seconds but still undefined.

I added the same debug on chrome and I could get the values.

Which is "funny" is that the timeupdate event is working fine on both platforms. It's like something is paused, but after clicking on play the initialization of the player finally ends. On chrome/firefox I don't have to click on play to get all the information.

Steps to reproduce

  1. Set the sources for a basic HLS manifest
  2. Wait for the events to be triggered
  3. Try to access the duration and current_time in the event callback

Results

Expected

The player is initialized so I should be able to access the duration and current_time.

Actual

Duration and current_time are undefined, the textTracks() is empty (should get 1 sub inside).

Error output

No error at all.

Additional Information

versions

7.2.1, but I also tried 7.2.2 and 6.11.0

browsers

FireTV web app tester

OSes

FireTV on a fire stick

If you have any idea,

Thanks

welcome[bot] commented 6 years ago

👋 Thanks for opening your first issue here! 👋

If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. To help make it easier for us to investigate your issue, please follow the contributing guidelines.

alex-barstow commented 6 years ago

Fire TV is not an officially supported platform for Video.js, so unfortunately we cannot guarantee it will work as expected there. Amazon does say Fire TV supports HTML5 web apps, but it's possible they aren't spec-compliant with regard to the <video> element.

As a side note, when you say player.duration() and player.currentTime() are undefined, do you mean they are actually returning undefined? Because regardless of Fire TV weirdness, that should not be possible: duration() should return NaN if the duration is not known, and currentTime() should return 0 in that case.

ZHAJOR commented 6 years ago

I saw that, and I can also add that it's impossible to play a DRM video with a web app on FireTV.

My bad, you are right NaN and 0. I will change of player. I just wanted to know if you had any idea of what was happening. If I play/stop quickly then the value of duration() and currentTime() are initialized.

You can close this issue, except if you have an idea (just curiosity).

gkatsev commented 6 years ago

If the FireTV browser gives us bad info, there isn't much we can do about it. Are you trying to play back DRMed video? That's another wrench in the system.

ZHAJOR commented 6 years ago

No just non-drm videos.

I just wanted to tell that it's impossible to play drm videos right now on FireTV using a web app. It's not supported by the platform. Only native apps can do that.

gkatsev commented 6 years ago

We have seen an issue with Safari where HLS videos don't actually get metadata in loadedmetadata but only in loadeddata and later. This could potentially be something similar where the implementation isn't strict to the spec and thus you end up missing info for a bit. Unfortunately, I'm not sure what to do, this is probably a native problem and probably needs to be fixed on the FireTV side.