11

I don't know how this happens and I can't see any errors. I can't seem to navigate through the video the second time I open my page.

See screenshot here: enter image description here

I have found this error it says,

TypeError: Floating-point value is not finite.
"Video is not ready. (Video.js)"

Help would be really appreciated.

Thanks

Grzegorz Oledzki
  • 23,614
  • 16
  • 68
  • 106
Shiro
  • 273
  • 4
  • 17
  • 1
    Hi Shiro, Its bit clumsy to understand your problem ! would you please explain ! What you need and what is exact problem? – pixelbyaj Sep 25 '13 at 16:59
  • 4
    [Here](https://github.com/videojs/video.js/blob/master/src/js/media/html5.js#L165) is the problem. You are probably supplying the video.js API with an incorrect parameter (which I can't say for sure, because you didn't supply any source code). Check your method signature and try again. – Brian Sep 26 '13 at 00:57
  • 2
    I suspect Brian is correct, but if you're still having trouble after please post a live example on jsfiddle.net or jsbin.com, and I will take a look. – jacobq Oct 18 '13 at 22:18
  • Have you tried keeping this code on some server like tomcat, IIS etc instead of running it on local drive. – Susheel Singh Nov 06 '13 at 10:39
  • We need to know, how you call the setCurrentTime method and what you pass as parameters. Since a type error is defined as the following, you are definately passing a wrong type of parameter: "TypeError: Represents an error when a value is not of the expected type." (MSDN) – Benedikt Dec 10 '13 at 08:17
  • Could you provide me with a Video.js version number, and the line of origin for this specific error? – Ryan Mar 18 '14 at 16:03

2 Answers2

1

When you say "I can't seem to navigate through the video the second time I open my page"? Do you mean you aren't able to play the video at all or that you aren't able to fast-forward and rewind within the playing video?

That you are getting a Type Error: Floating-point value is not finite error means that a certain parameter you're supplying to video.js is of the wrong type. I.e. you probaby supply video.js with a string when it wants an integer (or something similar).

Because it works the first time you load the page, are you trying to resume playback where you left off when you navigated away from the page?

If that's the case you are probably storing the currentTime parameter in a cookie or localStorage value as a string (using jQuery cookies for example these usually get automaticalyl stringified) and forgetting to switch it back to an int when you need video.js to read it back to you. Because what I notice about your screenshot is it seems video.js doesn't know the duration of your video (i.e. the seek time says 0:31 / 0:00)

Here's what you should do:

Clear you cache to get a working first time player load then:

Before starting play back, after playback has finished, and during playback you should log the current playback time signature, i.e.: console.log( videojs("id-of-your-video").currentTime() )

Adding time signature console.logs() to these video.js event callbacks should help you:

  • durationchange (fired if the total duration of your video changes)
  • duration (tells you the duration of your video. Try logging this while it works and again after it stops working and see what's changed in the value)
  • If you're still having trouble try logging values using the video js timeupdate callback. This event is called when the current playback position has changed (can be several times a second). If all else fails this callback might give you some insight into the exact moment you're getting the invalid type value, but it won't help you if you're problems are with trying to resume playback from a .currentTime() value reading from an incorrect type stored in user cookie / sessionStorage / localStorage etc.
DrewT
  • 4,983
  • 2
  • 40
  • 53
0

Are you Using a Server to execute it or are you running it locally. Because I got some similar issues when I ran it locally. But When I put the files in some server like tomcat or iis or whatever servers it worked. Not sure about the issue just a guess

Susheel Singh
  • 3,824
  • 5
  • 31
  • 66