From 171e703e1142f6e0a0f0efaf90541d179a2c63fd Mon Sep 17 00:00:00 2001 From: James Anderson Date: Mon, 8 Jul 2013 17:15:20 -0700 Subject: [PATCH] Mobile and tablet video rendering fix http://meta.discourse.org/t/chrome-for-ipad-iphone-breaks-with-this-video-embed/7983 --- app/assets/stylesheets/application/compose.css.scss | 4 ++++ app/assets/stylesheets/application/topic-post.css.scss | 4 ++++ lib/oneboxer/video_onebox.rb | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/application/compose.css.scss b/app/assets/stylesheets/application/compose.css.scss index f837593a8ff..925639ce8e8 100644 --- a/app/assets/stylesheets/application/compose.css.scss +++ b/app/assets/stylesheets/application/compose.css.scss @@ -299,6 +299,10 @@ webkit-border-radius: 4px; ms-border-radius: 4px; } + video { + max-width: 100%; + height: auto; + } } #wmd-preview { border: 1px dashed $gray; diff --git a/app/assets/stylesheets/application/topic-post.css.scss b/app/assets/stylesheets/application/topic-post.css.scss index dac676909fb..75223169398 100644 --- a/app/assets/stylesheets/application/topic-post.css.scss +++ b/app/assets/stylesheets/application/topic-post.css.scss @@ -515,6 +515,10 @@ img { max-width: 100%; } + video { + max-width: 100%; + height: auto; + } .topic-body { position: relative; .contents { diff --git a/lib/oneboxer/video_onebox.rb b/lib/oneboxer/video_onebox.rb index 2af9938f61b..032aa59efcb 100644 --- a/lib/oneboxer/video_onebox.rb +++ b/lib/oneboxer/video_onebox.rb @@ -6,7 +6,7 @@ module Oneboxer matcher /^https?:\/\/.*\.(mov|mp4|ogg)$/ def onebox - "" + "" end end