matijagaspar / ws-avc-player

Video player for browser that is able to play realtime low latency h264 video stream from websocket.
BSD 3-Clause "New" or "Revised" License
156 stars 48 forks source link

failed to create new instance of WSAvcplayer #13

Open Mjxa opened 4 years ago

Mjxa commented 4 years ago

Good day! I was trying to integrate your player into my React project, and on creating new WSAvcplayer(), getting error Cannot read property 'slice' of null, exception trowing in minified file of your library. exact place :function a(n){return n=n.toString().match(e).slice(1), After few days i diceded to console.log argument n & e, so i saw that e is a regular expression, and it was very similar to one regExp seen in github issue https://github.com/schmich/instascan/issues/154; so I changed local your code to this function a(n){return n=n.toString().match(/^function[^(](([^)]))\s{\s([^]?)[\s;](?:return\s(.?)[;\s])?}$/).slice(1) Its working ! Hope this will help you =)

matijagaspar commented 3 years ago

Thank you for finding this. Would be nice to find the actual source of that function. if you have any insight would be great. otherwise I will keep this open for when I have some time to address this.