videojs-markers icon indicating copy to clipboard operation
videojs-markers copied to clipboard

TypeError: Cannot read property 'time' of undefined

Open michaeldzjap opened this issue 9 years ago • 16 comments

This appears in the js console the moment the video ends playback for the first time using videojs 5. Restarting the video again makes these messages accumulate on a continuous basis. Full output in the console (Chrome):

Uncaught TypeError: Cannot read property 'time' of undefined in videojs-markers.min.js:3

michaeldzjap avatar Oct 11 '15 15:10 michaeldzjap

I'll take a look. Thanks for reporting :)

spchuang avatar Oct 20 '15 02:10 spchuang

fixed it in commit 702727

spchuang avatar Oct 20 '15 06:10 spchuang

Thank you!

michaeldzjap avatar Oct 20 '15 07:10 michaeldzjap

Hmmm... After updating to your latest commit it seems this problem still persists.

michaeldzjap avatar Nov 04 '15 10:11 michaeldzjap

Can you show me an example code so I can repro?

Sent from my iPhone

On Nov 4, 2015, at 2:51 AM, Michael Dzjaparidze [email protected] wrote:

Hmmm... After updating to your latest commit it seems this problem still persists.

― Reply to this email directly or view it on GitHub.

spchuang avatar Nov 04 '15 19:11 spchuang

I am getting this same error if I use markers: [ {time: 0} ]

I am getting this same error if I use below. I personally want to start with no markers. markers: [ ]

No error with this markers: [ {time: 1} ]

No error with this markers: [ {time: 0},{time: 1} ]

bigt11 avatar Aug 31 '16 18:08 bigt11

Facing the same problem, getting that error on console every second after re-playing de video

markers: [ {time: 2, text: "Marker text"} ]

marianoarga avatar Sep 26 '16 14:09 marianoarga

Hi all!

Is this bug fixed?

Cause I'm facing the same problem: When the video reaches the end at the first time, the errors below are throw to console:

error

I've already double checked and no mark is crossing the video duration.

I would appreciate if someone could share a fix or workaround.

Thanks! :+1:

videojs-markers version: videojs-markers - v0.5.0 - 2015-08-01

mauricioklein avatar Sep 29 '16 10:09 mauricioklein

Hi guys, sorry to get back so late. I can't seem to reproduce the problem when replaying video.

spchuang avatar Oct 24 '16 10:10 spchuang

Can you try it with the latest commit? If the problem still exists, it'll be great if you can provide a short demo that repros the issue! Thanks

spchuang avatar Oct 24 '16 10:10 spchuang

Still facing the same error on console after replaying the video with the lastest commit: VIDEOJS: ERROR: TypeError: Cannot read property 'time' of undefined(…)
@ video.js:6359 f.apply?f[Array.isArray(b)?"apply":"call"](d,b):f(b)};c.logByType=i,/**

marianoarga avatar Oct 24 '16 14:10 marianoarga

@marianoarga can you show me the code so I can try to repro?

spchuang avatar Oct 25 '16 02:10 spchuang

Does anyone found a fix (or at least a workaround) for this problem. I don't see a pattern on this error, happening with some cases. Thanks!

mauricioklein avatar Dec 06 '16 18:12 mauricioklein

@spchuang I think I found the error pattern: Here, in my project (which unfortunately I can't share any code), the error happens every time the last marker doesn't come after the video duration. When the last marker has it's time set to after total video duration, the error doesn't happen.

Please consider that I'm creating my markers in a crescent order of times.

So, for example: Video duration = 60s

Last marker time = 55s -> The error happens Last marker time = 65s -> The error doesn't happens

mauricioklein avatar Dec 06 '16 18:12 mauricioklein

@mauricioklein it makes sense that you can't share any real code :) But can you create a small and simple demo that reproduces the issue for me? So I can debug and fix it?

spchuang avatar Dec 07 '16 06:12 spchuang

@spchuang I'll try to do so in a JSBin, but I'm not sure if I'll be able to reproduce the error. I'll let you know.

Anyway, I'm now putting an extra marker on my setup, with time = Number.MAX_SAFE_INTEGER, which will be always greater than the video duration, and the error is gone.

Just to clarify: I'm intercepting the markers with the onMarkerReached callback.

Thanks!

mauricioklein avatar Dec 07 '16 09:12 mauricioklein