Hi,
I'm trying to render a youtube video/image into my content. The field in template.php contains
[2] => Array
(
[fid] => 26
[title] =>
[data] =>
[file] => stdClass Object
(
[fid] => 26
[uid] => 1
[filename] => Title of youtube file
[uri] => youtube://v/youtubeuri
[filemime] => video/youtube
[filesize] => 0
[status] => 1
[timestamp] => 1356531088
[type] => video
[rdf_mapping] => Array
(
)[entity_view_prepared] => 1
))
Is there anything I could use like in images, such as
theme('image_style',array('style_name'=>'media_youtube_image','path'=>$media["file"]->uri,'alt'=>$alt,'title'=>$title))
Thanks
Comments
Comment #1
RobW CreditAttribution: RobW commentedYou should use Media: YouTube's built in image formatter. Set up a new view mode for your file types, add the image formatter for the video output, and then use the rendered file for that view mode in your content. For working with view modes, see the Media documentation: http://drupal.org/node/1793548.
Comment #2
RobW CreditAttribution: RobW commentedComment #3
symeon.mattes CreditAttribution: symeon.mattes commentedIs there any step-by-step tutorial for that? The link you sent me gives some definitions without any examples
Comment #4
symeon.mattes CreditAttribution: symeon.mattes commentedEven for the default view mode...how do I use it?
Comment #5
symeon.mattes CreditAttribution: symeon.mattes commentedI don't know if it's the proper way, which I would like to know, but the following, which I found in youtube module, worked for me
This what I have used in template.php
Comment #6
Devin Carlson CreditAttribution: Devin Carlson commentedYou'll probably want to use file_view_file();
Comment #8
panditvarun20 CreditAttribution: panditvarun20 commentedI have created a custom block for video. how can i render it using hook_block_view