-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
this.videoWidth should be exposed #1901
Comments
Can you say which browser you're using and any plugins? You could help us by creating a jsbin for your script there so we can verify it quickly. And then the next steps we would take here is to determine if anything changed with the video tag itself in the specific browser you're testing in. |
Was So anyway, I'm not sure what version you were using, but afaik, those methods have never been available in 4.x |
width() and height() do not return the actual video's dimensions. What I'm doing here is setting the wrong dimensions beforehand and then resizing once the actual video's dimensions are received from the meta data. It must have been before 4.0.0 then but it used to be a thing because this used to work. And it should be a thing now. What's the point of a loadedmetadata event if you can't use the metadata? I'm on Windows 7. I'm using Firefox 36. I tried Chrome 40 and IE 11. It's not a browser issue. |
I absolutely, 100% agree that this should be implemented, I'm just nearly positive that it never was (that's 3.2.2, the last 3.x release). Perhaps you were querying the actual html5 tech for the information? You could still do that, it just wouldn't work for Flash. |
I tested back to 4.3 and couldn't find one that worked but I swear I was doing it at one point but perhaps you're right. While you're in there, what other metadata is accessible that isn't exposed? |
This list should about sum it up. |
Maybe this will spur someone to add these features. I tried adding: vjs.Html5.prototype.videoWidth = function(){ return this.el_.videoWidth; }; vjs.Flash.prototype['videoWidth'] = function(time){ vjs.Flash.prototype['videoHeight'] = function(time){ but it didn't work so I'm using (I'm using jquery here but you can easily change it to just DOM calls): videojs('video', {}, function(){ |
I found my code that exposed this.videoWidth inside $('#video').on('loadedmetadata', function() {} It seems to have something to do with using jquery and setting: var v=$('<video id="datbox_video" preload="auto" controls="controls" autoplay="autoplay" class="video-js vjs-default-skin" style="display:none;"><source id="datbox_source" src="'+$(el).attr('href')+'" type="video/mp4" /></video>'); Any idea why this works? Source code (datbox.js) http://sethb.org/datbox/ |
I don't understand, I followed all the related tickets, I just downloaded the latest version, but I still don't see how to read the metadata videoWidth? any pointers? |
Oh, I think i get it now
|
Can also do the trick |
I used to be able to use the loadedmetadata event to change the video player width and height once the meta data was loaded but now this.videoWidth and this.videoHeight return undefined. It's been like this for the past few months worth of patches. not sure when it was broken
Edits by @mmcc: Code fences
The text was updated successfully, but these errors were encountered: