VideoSub
VideoSub copied to clipboard
throws errors on pages with no video tags
This is a problem if you're building a library which may or may not have video on page load. For example in any modern javascript application.
Simple fix - in videosub_main add this as the second line:
if(!myVideo) { return; }
and then add below the domReady call:
$VIDEOSUB.fn.videosub = videosub_main;
So the code is callable when needed. In fact I'd suggest removing the dom call entirely.