Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Undefined' issue with changing RTMP source on compressed video.js build #1612

Closed
jsmits21 opened this issue Oct 27, 2014 · 4 comments
Closed

Comments

@jsmits21
Copy link

I get 'undefined is not a function' when dynamically changing the rtmp src on my videojs instance. The function appears to be "this.ue(a.wb)". When I switch to the dev js file, the error does not happen. Looks like an issue with your minification process possibly. If you need more info let me know.

@mmcc mmcc added bug needs: reduced test case A reproducible test case is needed. See https://stackoverflow.com/help/minimal-reproducible-example confirmed duplicate and removed needs: reduced test case A reproducible test case is needed. See https://stackoverflow.com/help/minimal-reproducible-example labels Oct 27, 2014
@mmcc
Copy link
Member

mmcc commented Oct 27, 2014

Hi there, this is a known issue: #1399. Closing this as a duplicate, but thanks for the reminder. We haven't had a chance to take a look yet, but are you interested in digging into a solution for this one?

@mmcc mmcc closed this as completed Oct 27, 2014
@jsmits21
Copy link
Author

Hey Duder,

A little update after spending all day on it. I'm using VideoJS in my single page application. The flash RTMP fallback is used if the videos haven't been moved (or if you're using an ancient browser, naturally). I believe a lot of the problems people see with destroying players is related to flash events being triggered on things that no longer exist.

I moved my player views to a global data array. My view manager will always close video players first before any view switching occurs. I was still having the same issues as when I was trying to manage them within their own view with a close event.

As dumb as it sounds, telling the player to pause prior to closing views fixed my console errors. It appears that even during cleanup, a flash file might still trigger events on the player object, causing weird issues. Making sure flash events have ceased by pausing it fixed the issues for me. Maybe you guys just need to take another look at your dispose method? Maybe it needs a finished callback similar to how initializing it has an onReady()? I didn't get very far into the dev code, but this feels right.

@mmcc
Copy link
Member

mmcc commented Oct 27, 2014

Hmmm...I think I might have misunderstood the original issue. We realize there are some shortcomings with disposal (things like #1541, for instance), but I assumed the problem you were seeing was a process like this (assuming you have an initialized player with an id of neato-video):

  1. var player = videojs('neato-video');
  2. player.currentSrc(); (returns some RTMP address)
  3. player.src({ src: 'rtmp://some-other-server.com/&mp4:blah/woo_640_300.mp4', type: 'rtmp/mp4' }); (returns failure and sadness)

Disposing the player every time and bringing up a new one with a new source should skirt around this entirely, and really is the only way to do what you're talking about, particularly if you're using Flash (flash explodes when hidden).

@jsmits21
Copy link
Author

Yeah there are definitely pitfalls with disposing players that you have to be careful with, whether its HTML or Flash. I haven't had any trouble using load to switch RTMP sources. There is a problem with 'dispose' when using flash I believe though. I'm pretty confident because simply calling 'pause' before 'dispose' fixes the event bug for me. I found it when I switched views after a video had stopped playing and realized that was it all along. I'd look at the flash listeners when disposing the flash tech. There is definitely something funny going on there where they are gone but Flash still hits them or vice versa. It could only be with RTMP for all I know.

VIdeojs is the best player I've used for single-page apps yet. Great job!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants