Add video filter, which allows user to inject video player into text (ie. some story or page node).
[video=X,autoplay=Y,align=Z]
where:
X - is node id (nid) of video node.
Y - may be true or false. specifying it is optional, and false by default.
Z - may be one of: left, right, center, none. it's also optional and 'none' by default.
Because only first option is required to inject player, minimum required syntax is:
[video=X]
Patch changes some internals so now any other module can call theme_video_play($node, $autoplay = false) function to get html code for player (in case some may need it in future :).
Currently parsing of options is not so "clean" and could be made better, just in case we'll want to add more of them at some point in future. Also theming functions for each format of video could get array of options as 2nd argument instead of autoplay (instead of making list of arguments longer with each optional thing we could just pass array of parsed options).
Please review, and let me know if You like it and if i should change/fix something :).
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | video.patch_0.txt | 22.28 KB | ahwayakchih |
| #3 | video.patch.txt | 22.28 KB | ahwayakchih |
| video_0.zip | 4.68 KB | ahwayakchih |
Comments
Comment #1
fax8 commentedgood work ahwayakchih.
I like the redesign to the theme play functions.
The best thing should be separete the filtering stuff from the video.module
which I want to mantain as simple as possible. A better solutions should be
create a video plug-in under the 'plugins' dirctory of the module.
This will let users use this feature only if they really need it.
Moreover the code in the 'process' case of video_filter is really hard to read and understan.
Something for this should be done.
Thanks a lot for your help.
Please try to solve this problems and I will commit this on cvs.
Fabio
Comment #2
bwynants commentedhttp://drupal.org/node/32838 has a parser for arguments.....
Comment #3
ahwayakchih commentedHere's ne patch.
It changes theming internals in video.module, and creates new video_filter plugin.
Comment #4
ahwayakchih commentedSorry there was a bug there. This one works ok :)
Comment #5
szuhuey commentedHello,
Is this patch complete? I tried to apply it but I do not see anything special regarding video_filter except being able to enable it in the modules list. Is there any setting I need to change? Can you please give me some instruction on how to apply this module on let's say attaching a video file to a blog entry? Thank you so much for your help!
Comment #6
szuhuey commentedHello,
I found out that I had to enable the input format "Inject video". So right now [video=x] where x is nid of my video works!! Thanks.
However, I noticed that even if i specify [video=28,autoplay=false,align=right], the video still start playing right when the blog is viewed. And the video is on the left hand side of the screen instead of the right hand side as I specified. So it seems to me that the autoplay and align options are not working? Am I missing something here?
Those two are small concerns of mine. The major one is:
HOW CAN THE USER FIND OUT WHAT THE NID IS FOR THE VIDEO THEY JUST UPLOADED?
I am assuming the users has to create content of video first and then put that text in. (Please correct me if I am wrong about the steps to use this patch, thanks). It seems like a low level stuff that only the administrator will know; I was able to find out the NID because I have access to the database.
I am building a website where the users can attach/insert videos along with their blog entry. Is there any other modules/patches/plug-ins that can allow the user to do this in a simple way? I am looking something similar to what img_assist does for attaching images to blogs. I can see it as an extremely useful feature for the users to be able to attach videos as well.
Thank you so much in advance for any help!
Comment #7
brollo commentedHi,
Sorry, I dont understand.
With these patches, can I include embedded video created by the video module inside any kind of other content type? (ie blog posts, story, etc etc) ??
If possible, could you please explain how to apply the patches? Do I overwrite the module files to the ones in the patches archive? (of course renaming the patch files)
Or do I simply paste in the patches as they are?
I am running drupal 5.x. , will it work considering that you mention to use Videos 4.x module?
Thanks for your time
Comment #8
iLLin commented