bahriddin / ckeditor-html5-video

HTML5 video plugin for CKEditor
GNU General Public License v3.0
37 stars 36 forks source link

Responsive video #1

Closed smartcorestudio closed 7 years ago

smartcorestudio commented 7 years ago

Hi Bahriddin! Don't you think about adding "Responsive" option? I think it can be easily implemented video { width:100%; max-width:500px; height:auto; } max-width is optional of course. If you'll like the idea and need help - feel free to ask me, I'll try if I can

bahriddin commented 7 years ago

Thank you @smartcorestudio for this idea. But how do you want to make it responsive? I make it as you said. But it shows in video's real size (in my case, not 400x300, but 480x360). What if I will place 1080-wide video? Maybe I didn't catch you. Please, share further details. Thank you for your answer in advance

smartcorestudio commented 7 years ago

Hi! Please look at this fiddle and try to resize results column to see how it works. The native width of this video is 787px. If you'll place 1080-wide video it will take the whole width of it's container. If you WANT, you CAN add additional max-width setting to scale video only down but not up. But I think it should be optional because sometimes you don't need it. So, ideally, I see the following way: if user checks "Responsive" checkbox in the dialog window, he sees optional "Maximum width" field. Otherwise he sees "Width" and "Height" fields as it is now.

smartcorestudio commented 7 years ago

Hi again! I've added "Responsive" checkbox in the dialog window. It adds 2 styles "max-width: 100%; height: auto" to the video tag. Please look at the video in the updated fiddle https://jsfiddle.net/wn0hcgLj/1/ Also I've fixed the bug when width and height values were dropped after switching to the source mode and back. I'm going to make a pull request

smartcorestudio commented 7 years ago

Could you please update your plugin to the latest version in the CKeditor Add-ons list http://ckeditor.com/addon/html5video ? It's needed for CKBuilder users. Thanks in advance!

bahriddin commented 7 years ago

Can you explain the thread more broadly. I can't understand you.

smartcorestudio commented 7 years ago

I mean the following: here http://ckeditor.com/addon/html5video you can download only initial version of the plugin (05 Jan 2017). After that you've added "Responsive" feature here, on GitHub. But you didn't add the updated version into CKeditor Add-ons list. If you want I can try to explain you in Russian :-)

bahriddin commented 7 years ago

Oh man, I forgot that we upgraded to the new version. Sorry. I am doing it now)