-
-
Notifications
You must be signed in to change notification settings - Fork 338
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
<video> element sizing behavior: support for 'object-fit' and 'overflow' styles #23
Comments
This is the outcome of the discussion in aoberoi/cordova-plugin-opentokjs#5 |
Good test case: http://jsbin.com/yaheka/edit?html,css,js,output |
Excellent report, and a "must have" for the plugin. I will do my best effort on this subject next week once I get some spare time. |
Guys I'm working on this and can already detect the CSS "object-fit: cover" but cannot figure out how to translate that at the native UIView level. I've open a thread in discuss-webrtc: https://groups.google.com/forum/#!topic/discuss-webrtc/FnSOHqvFbEw |
All the values of |
@ibc: wow, super fast! thanks for that. i'm working on some other problems in the layout for the opentok layer, but i'll pull in the latest the dependency soon. i'll report back my results. in terms of |
@aoberoi since you mention usage of Regarding the May you please share an usage example so I can understand the goal better? |
@ibc i was not aware of that chrome bug, but i have starred it. thanks for pointing that out. i'll try to get more of my team members to star it as well. if the expected behavior is as they describe, then we will not need |
It is clearly a bug in Chrome. Just open the same link in Firefox (it would also work in Safari if you replace the OGG video with any MP4 video or other format supported by Safari). Basically the cordova-plugin-iosrtc behaves better than Chrome in regards to the CSS |
Right now the MediaStreamRenderer will always render video by scaling it down so that the entire frame fits within the
<video>
element (preserving aspect ratio and centering) and fills the rest of the area with black pixels. This is equivalent to the standards when the<video>
has the default styles applied (specificallyobject-fit: contain
).I'm interested in support for the
object-fit: cover
style. This behavior is different in that the video frame is scaled up to as large as it needs to grow in order to draw in all the pixels inside the video element (preserving aspect ratio and centering). There are no black pixels.With that style alone, it actually draws video outside of the bounds of the video element. I believe a common use case is to pair this with
overflow: hidden
on some parent in the DOM tree so that the video frame is "cropped" to the bounds of a certain size. I understand that implementing this in the MediaStreamRenderer would mean you would have to observe every parent of the video element up the DOM tree and that would probably be too slow. I want to suggest that we only aim to implement the correctoverflow: hidden
behavior for its direct parent.The text was updated successfully, but these errors were encountered: