BigVideo.js icon indicating copy to clipboard operation
BigVideo.js copied to clipboard

use dom traversal for element selection to allow multiple videos

Open sparksm opened this issue 10 years ago • 7 comments

I needed to run multiple for a project. Figured I'd contribute back. With this it uses the container's children to add and refer to elements rather than id's. Also threw in a jQuery helper function to allow $('.video').bigvideo().bigvideo('init').bigvideo('show'); It also uses data-video on elements to load that video.

sparksm avatar May 30 '14 20:05 sparksm

I'll look into implementing this soon. Thanks!

johnpolacek avatar May 31 '14 20:05 johnpolacek

When I pulled this code into my demo pages, the VideoJS breaks with this error: Uncaught TypeError: The element or ID supplied is not valid. (videojs)

The stack trace points to line 279 of BigVideo.js

More important than this though is that I no longer have write access to this repository (I left the company almost a year ago).

johnpolacek avatar May 31 '14 21:05 johnpolacek

My privileges have been restored. If you can fix the issues and get the demo working with your new code, I'll be happy to accept your PR.

johnpolacek avatar Jun 03 '14 15:06 johnpolacek

from where can i pull your demo code?

sparksm avatar Jun 03 '14 15:06 sparksm

It is on the gh-pages branch.

johnpolacek avatar Jun 03 '14 15:06 johnpolacek

Would love to see this integrated into the master branch. :+1:

pattiereaves avatar Jun 20 '14 20:06 pattiereaves

FWIW when I used this in a project, the updateSize function broke (so it was not scaling to cover the background). I changed the query to get the mediaAspect on line 321 to query on .vjs-tech and the updateSize function on line 88 and 114 to query on that selector. And also var vid = container.find(vidEl); on line 58 was not getting the right element (the parent div of the video, it was getting the video element itself).

pattiereaves avatar Jun 24 '14 02:06 pattiereaves