Closed (won't fix)
Project:
Media Field
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
25 Feb 2007 at 03:23 UTC
Updated:
28 Feb 2007 at 20:17 UTC
How do I get the link in the embedded player (for instance Windows Mediaplayer)? Guess I have to make a new node-type.tpl.php but how do I put the link in it?
Perhaps some default code or examples? Thanks!
Comments
Comment #1
ardas commentedTry http://drupal.org/project/coolfilter module which should be able to embed a player into your web page and stream any media file including files uploaded by audio and video CCK fields.
Comment #2
maastrix commentedthanks for your reply but I ment some default code for cck's node-type.tpl.php.. that's also possible isn't it? I'd rather not install an extra module. I allready had to install 20 modules to get what I want..
Comment #3
ardas commentedMy project consists of 107 modules at the moment :)
It is not a good approach to dublicate such code and try to do it on your own. Unfortunatly, I don't know how to embed media content and I won't be able to help you. I hope, people who know the answer worked a lot to put it into a module for guys like me and you to use it. This is a power of community:)
If you still want to put your own piece of code, download coolfilter and take something from its source.
Comment #4
maastrix commentedI think I'm being misunderstood. This is the code needed in a templatefile to make the movie play in Windows Mediaplayer.
Where it says
<PARAM NAME="URL" VALUE="your file or url">it needs an URL. That url is outputed by the mediafield module but just as a direct link to the file. I want to implement this code in a node-type.tpl.php file and output that direct link to the file on the place where is says PARAM NAME = URL. Should be easy but I can't find the line of code that does that..Or is that not possible and do I really have to use that extra module?
Comment #5
ardas commentedI don't know is it possible to make this piece of code work correctly in all browsers. You should try it. I've never do it before. If it fits your needs you can of course leave it and don't use any other module. This is your choice anyway.
As for file information, you should investigate the structure on $node variable which is used within node.tpl.php template. You will find all CCK fields there and your video field will be also there with some information including file path.
Comment #6
maastrix commentedPlease don't be offended but what is the use of a audio or videofield if you can't theme it? You might as well upload a file using the filefield cck module.. wouldn't it be great if you can actually show the video on your website?
In this topic they are changing the way imagefield behaves: http://drupal.org/node/101710. Would be nice if I knew how to use the code of mediafield to get single variables out of it. Like:
<?php foreach((array)$field_videofield as $item){print $item['url]}or something like that.if you use an FLV player using flash, it will work on every platform.. check out this demo of the video module:
http://www.varesano.net/video-demo/?q=node/12/play
and more: http://www.varesano.net/video-demo/
Comment #7
ardas commentedI didn't say that it can't be themed. Of course it can, there are several modules which do this and coolfilter is one of them. There id no need to duplicate video streaming logic because it is already done in other module. Video field information is populated into $node object just like all other CCK fields. You can get it from there.
Video.module you mentioned is an alternative solution. Feel free to use it if you want.
Comment #8
maastrix commentedallright, thanks for the info so far. You say: "Video field information is populated into $node object just like all other CCK fields. You can get it from there.". How can I do that? What's the magic line to output the url? :)
Comment #9
ardas commentedecho "
";
Comment #10
fax8 commented@impahz
ARDAS is trying to explain that he does not suggest you to add your code to embed
because there are already different modules which can do this for you.
Then the correct approach for a programmer should reuse what is already available
and use it.
I suggest you to install my video module which already has embedding functions available.
So... you should have the video path stored somewhere in your CKK $node
(a print_r($node); should let you show where...)
You should pass this to theme_video_play_X where X is the type of video available with also
the width ($node->videox) and height ($node->videoy).
Then print the output of the theme_video_play function.
Hope this helps.
Comment #11
maastrix commentedBoth thanks.. I have something working now. Since I'm only allowing one type of video, I only have to make one template with the code in it. At the moment I have it like this: