Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
would be swell to allow the passing of attributes instead of filtering them all out
namely,
&autoplay=1
would be nice.
Comment | File | Size | Author |
---|---|---|---|
#9 | moreoptions.zip | 5.05 KB | misthero |
#5 | youtube-autoplay-formatter-1483054-5.patch | 2.93 KB | jenlampton |
#4 | youtube-autoplay-formatter-1483054-4.patch | 2.89 KB | guschilds |
#2 | youtube_field-autoplay-formatter-1483054-3.patch | 2.75 KB | guschilds |
Comments
Comment #1
jenlamptonYep, this sounds reasonable, can you make me a patch file?
Comment #2
guschilds CreditAttribution: guschilds commented@Andrew_Mallis
Attached is a patch that creates an Autoplay option on the field formatter (Structure > Content Types > Manage Display > click the gear). When checked, all YouTube videos provided in that field will autoplay. This could obviously get messy if you were using Views, etc., but when is auto-playing videos not at least a little bit messy. :)
I believe the original patch was asking for the ability to pass "&autoplay=1" through the field input to allow a single video to autoplay. I'm thinking this may be better accomplished by an Autoplay checkbox on the field widget, with the option to not allow that checkbox (probably off by default, really). That way you aren't requiring users to understand much. What do you think?
I implemented the attached patch first simply because it was easier and may be helpful for some. Because I don't think it satisfies the original request, I won't change the status to "needs review". Feel free to do so, however, if you think this is enough.
Comment #3
jenlamptonI think the field display settings are also available to views - so this may be a suitable solution for that case too. I agree there might also be a need for a per-video solution, but I don't like that as much since it doesn't account for view modes.
Let's go with this for now.
Can you re-roll the patch against the lates 7.x-1.x branch? It won't apply cleanly for me anymore :/
Comment #4
guschilds CreditAttribution: guschilds commentedI agree. You were correct, this setting is also available to Views. Re-rolling the patch exposed a few minor mistakes I made the first time through. This one should be good and apply cleanly to the 7.x-1.x branch.
Comment #5
jenlamptonThis patch looks great :) Thanks!
I changed the default value to FALSE (box not checked) rather than NULL in a few places, and I changed the label of the checkbox from just 'Autoplay' to 'Play video automatically when loaded (Autoplay).'
For some reason this patch breaks the form #states for custom video sizes on the article content type, but not on the page. I think it may just be my set up, so I'll start over with a clean db and do some more testing, but wanted to throw this patch back up and see if anyone else gets the same behavior.
Comment #6
jenlamptonJust a note, I found the form states bug, and it has nothing to do with this patch. I'll fix that separately :)
Comment #7
guschilds CreditAttribution: guschilds commentedI agree with all of the changes you made in #5 and the patch works as desired when applied.
Comment #8
guschilds CreditAttribution: guschilds commentedcommitted to the 7.x-1.x branch.
Comment #9
misthero CreditAttribution: misthero commentedsorry wrong topic, I moved my post here: http://drupal.org/node/1571420#comment-6415246