Youtube embed size


(Tomo Vukasović) #1

I have searched the forum. No luck.

Embedded YouTube video size seems small for our forum taste. How can we increase this?


YouTube/Vimeo embed size controls in Settings
Youtube embed size, revisited
(Arpit Jalan) #2

The data-width and data-height attributes defines video embed size:


#3

Great. Is there a way this attribute can be set in site settings? Also, is there an attribute that enables HD playback by default?


(Tomo Vukasović) #4

That sounds like a great plugin. Unfortunately, I have hard time with plugins since I am a complete beginner when it comes to ruby and docker setup. I understand the concept that plugin git needs to be added to app.yml

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - mkdir -p plugins
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/lazyYT.git

After this I simply:

./launcher rebuild app

Everything beyond this is a newbie unfriendly territory.

Firstly, I am not sure if I completed all steps properly since I done this blindly. After installation I am not sure where my plugin files are located.


#5

The plugin is already included in Discourse so you donā€™t need to add it to the app.yml. Once the build/rebuild has completed then type:

./launcher ssh app

This will let you ssh into the actual docker instance and then you can go to /var/www/discourse/plugins/lazyYT and edit the attribute on the plugin.rb file. Unfortunately, when you rebuild the changes will disappear and you will have to edit it again.


(Tomo Vukasović) #6

I found it finally. Is it possible to view/edit this file through SFTP over SSH? I am not seeing www folder in var directory under DigitalOcean Ubuntu setup. Thanks a bunch.


(Jens Maier) #7

Remember, Docker is like a server inside your server. When you connect to your DigitalOcean droplet with SFTP, youā€™re in the ā€œouterā€ server, the Docker host. Butā€¦

Inside the container that, well, contains your Discourse instance, thereā€™s another SSH server running, but this one ends up listening on port 2222 (unless youā€™ve changed the default configuration in your app.yml). If you want to ssh directly into the container, you will need to copy the SSH private key that was created during the bootstrap process. If youā€™ve followed the DO setup guide, this is in /root/.ssh/id_rsa. Once that key is on your local machine, set up your SFTP client to connect to your server on port 2222 with username root and using public-key authentication using the private key you just copied.

Just keep in mind that any files you create here will be owned by root and can easily interfere with Discourseā€™s automatic upgrade process.


(Tomo Vukasović) #8

Easily part scares meā€¦thanks for great explanation. The last newbie question would be: How to edit plugin.rb when nano is not supported? At least it gives command not available in my instance console.


#9

Yeah, you want to use vi instead instead.

vi plugin.rb

(Tomo Vukasović) #10

Thank you Chili. I managed to save file with vi, but I am not seeing any YouTube size changes in my instance. Is there something else that needs to be done? The final stroke :smile:

I assume I need to restart application:

./launcher restart app

(Jeff Atwood) #12

This request has come up often enough that I think we should add some way to configure the video embed sizesā€¦


(lid) #13

We can probably use a similar approach like the PR I sent for the flash embed onebox


(Jeff Atwood) #14

No, I think this should be a global via site settings.


(Sam Saffron) #15

We distribute this plugin with core, no need to add it againā€¦


(Tomo Vukasović) #16

Got it. I hope you will sort it out, but it is not as important as some other issues so no worries here.

@Frank What happened buddy it was cool post :slight_smile:

Docker is great for setting up new environments, but also extremely complicated to work with simple things. I am excited to watch the course of discourse. If your customers fail you rest assured that free community will help you survive.


#17

Well, I was trying to do ā€˜dream within a dreamā€™ connections and after I read it I didnā€™t like the tone (not very funny) so I deleted it.

I am learning more about docker personally because I think I could use that with some of my internal project but you are right it is complicated (then I look at puppetā€¦and its complicated too)ā€¦However Docker with Discourse does teach me a ton of things about design, programming and distribution (the last part has, over time, become problematic for me).

:slight_smile:


(Travis) #18

I would probably just make it respect max image width and perhaps rename it to max embed width. For me at least, all of the embeded content widths are going to be the same value based on the design of my forum.


(Bart) #19

Any updates on this? Iā€™d love it if my forum looked a little cleaner - we have quite a few YouTube video posts.


(Mykhailo Poliarush) #20

so will it be implemented?


Embedded Youtube videos fixed size
#21

Yes please! almost two years since first requested this :smile: