Hola people,
I spent half of my day trying to figure this out so I think I'm now allowed to ask it here.
I've got a content type that users can create, and I want them to be able to add videos from youtube, dailymotion and vimeo simply by providing a link in some textfield. This is checked.
Now, this content type is outputed via a custom module. I would like to find another module that would allow me only enter the video link into some piece of code and that would generate the rendering automatically.
Using emfield I saw I could get link+provider (and others) attached to the node. I didn't find however how to render the video with that module. So my alternative would be to do a check on the provider, and then output a generic code for the rendering.
I might just do that. But before, I noticed that Emfield allowed the use of other media players, which I assume would replace the default 3rd party players. I'd like very much to use that functionality. I also found SWTools, SWF Embed, Flashy and others that do so but as I understood it is required to have files on the server, which is hardly a possibility for me.
My final question is therefore: how can I render a video player within a page with the 3rd party video link as a sole argument?
Thanks,
saipas
Comments
You Can't
If I understand your question correctly, you can't. EmField is great, but as you noticed you have to point to the media that exists somewhere on the internet. You may be able to point to it on your own server, if you can upload it in an acceptable format. There is a "custom" type for that.
But when you say: "I understood it is required to have files on the server, which is hardly a possibility for me." and "how can I render a video player within a page with the 3rd party video link as a sole argument?" It sounds like you want EmField to encode, upload, and link to your video, which I don't see it able to do.
A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com
Hi mcfilms, Thanks for your
Hi mcfilms,
Thanks for your answer.
I suppose I expressed myself incorrectly. In practice, here's what I'd like, step by step:
1/when creating a node, users enter a Youtube/Dailymotion/Vimeo video link into a textfield
2/in my module I write some function that takes as an argument a video link and outputs a video player
3/in the theming function I call the previous module function and passes the node video link to it
Quite simple wouldn't it?
The easiest way, if I find no other, is to put the code '
In emfield I see that it's possible to use JW player and SWFObject (I don't know how to use that but it's there). Is it limited to self-hosted videos or also available for 3rd party hosted videos?
Embedded Media Field
This is precisely what EmField enables you to do. But instead of a text field in CCK, it is a field for the embed code. And you configure the module with whichever player you want to use. (You can also set up thumbnail sizes.)
So you have a node, it has a title and an EmField (and other fields and taxonomy if you wish).
Then you can either theme this node or use Views to output the node in any way you wish.
Really. spend some time with EmField. View a tutorial. This module was made for you.
A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com
Haha, I had already added a
Haha, I had already added a CCK emfield to my content form and noticed that it added lots of info about the video to the node, but couldn't find out how to display the player. If you say that's feasible I'll have a more thorough look. Will keep you posted :)
Sooo, I spent quite a few
Sooo, I spent quite a few more hours on that issue, and here's what happened:
After looking into all files in the emfield directory I finally found the theme function emvideo_video_video. Below is an example code on how to use it:
This will show the default player for the video node, which has been set into emfield settings.
I also lost some time with the swf object settings/emfield_swfobject function and couldn't get this to work with youtube whichever my version of swfobject (1.5, 2.1, 2.2). Other providers work. I eventually abandoned since I don't even know what's the purpose of that function...
I went onto the JW FLV player, to notice that only youtube implements it. So I also abandoned that feature.
Finally, I looked for some player and found that flashy does implement a link function in addition to a cck field. I tried and looked into it but it seems to work poorly. I filed an issue here: http://drupal.org/node/679752
Dash player was last on my list. I didn't go into details since I was getting a bit fed up and only youtube works but it looks like a nice player anyway.
Since other solutions don't satisfy me I'll leave the default 3rd party player, I guess I can live with it for some time...
Now I'm looking for a way to change the front image when the video is displayed (before it plays).