-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
show() not showing video with video tag display: none #1680
Comments
This seems like a duplicate of #1679. |
I don't think this is a dup. 1679 is about loading a flash vid. You closed 1679 b/c flash is finicky and you may not be able to do anything about it. This issue is with mp4 NOT flash. Example code is very similar, but loading an MP4. This should be reopened. |
I think the issue is that the style is on the video element and it stays on the video element when |
You're right, this is not an exact dupe, but I also don't think this is a Video.js issue. The |
The sample code gets the original ID (video1) and does a jQuery.show(). Looking at it in Firebug the jQuery .show() removes the display: none; from the div container. Then the code calls this.show() where 'this' is the vjs object. My expectation is that the vjs show() api will deal all the items it created and show the video. It does not. I don't think the user should have know the internals of vjs and have to know to remove the display:none from the .video-js class. The vjs api should handle that. Am I looking at this incorrectly?? |
I think you're misunderstanding me. The issue (I presume) is that you're hiding the I was using |
Example. Note, that |
Ah. I get your point. And will change my code accordingly. Thanks for the example. Seems the issue was around the display:none being in the tag itself. I do wonder, however, since the orig video tag was display:none in the tag and then vjs applied to it, that perhaps vjs should consider itself in hide state -- and thus show() should work. But that is probably a corner case and there is clearly an alternate way to handle it. Thx. |
Cool! Glad that works. I disagree on the notion that VJS should be crawling styles outside of its scope to make decisions about behavior. Take jQuery's What we should actually be doing is using the |
Opened #1681 to use classes instead of setting inline styles. |
Detailed description of what you did, along with a link to your reduced test case.
video tag has style display: none
load mp4
loaddata event triggered
this.show() does not show the video.
Replace the code sample below with your own.
What happened? (actual results)
The video is played but not displayed
If the video tag has display: block -- works as expected
What should have happened? (expected results)
video should have been displayed.
Video.js version (e.g. v4.3.0)
4.10.2
Video.js plugins used (e.g. videojs-youtube)
none
Browsers + platforms where this is happening (e.g. Windows XP IE8)
Windows 8:
Firefox 33.0.2
IE 11.0.9600.17351
Chrome 38.0.2825.104 m
Browsers + platforms where this is NOT happening (e.g. Mac Chrome 30)
No others tried
The text was updated successfully, but these errors were encountered: