Closed (fixed)
Project:
YouTube Field
Version:
7.x-1.0-alpha2
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
15 Mar 2012 at 03:35 UTC
Updated:
13 Sep 2012 at 13:31 UTC
Jump to comment: Most recent file
Comments
Comment #1
jenlamptonYep, this sounds reasonable, can you make me a patch file?
Comment #2
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 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 commentedI agree with all of the changes you made in #5 and the patch works as desired when applied.
Comment #8
guschilds commentedcommitted to the 7.x-1.x branch.
Comment #9
misthero commentedsorry wrong topic, I moved my post here: http://drupal.org/node/1571420#comment-6415246