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

use dom traversal for element selection to allow multiple videos #126

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sparksm
Copy link

@sparksm sparksm commented May 30, 2014

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.

@johnpolacek
Copy link
Owner

I'll look into implementing this soon. Thanks!

@johnpolacek
Copy link
Owner

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
Copy link
Owner

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.

@sparksm
Copy link
Author

sparksm commented Jun 3, 2014

from where can i pull your demo code?

@johnpolacek
Copy link
Owner

It is on the gh-pages branch.

@pattiereaves
Copy link

Would love to see this integrated into the master branch. 👍

@pattiereaves
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants