Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

DataObjectManager Module

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

video not showing in the pages

Go to End

33 Posts   4589 Views


26 January 2010 at 1:48am Community Member, 97 Posts

I am trying to create a video gallery from flv files,when i am uploading the file it is creating the thumbnails but when I am opening the pages it is only showing the title and description but not the file,it is not playing the file and there is no error also.i have used the devlopment mode still i did not got any error.I got the code in this forum provided by UncleCheese, The code for the pages are given below.


class Video extends DataObject
   static $db = array (
      'Title' => 'Varchar(100)',
      'Description' => 'Text'
   static $has_one = array (
      // Make sure this comes first
      'Video' => 'FLV'


class VideoPage extends Page
   static $has_many = array (
      'Videos' => 'Video'
   public function getCMSFields()
      $fields = parent::getCMSFields();
      $fields->addFieldToTab("Root.Content.Videos", new FileDataObjectManager(
         array('Title' => 'Title', 'Description' => 'Description'),
         new FieldSet(
            new TextField('Title'),
            new TextareaField('Description')
      return $fields;

class VideoPage_Controller extends Page_Controller

<% control Video %>
$Video (no control needed)
<% end_control %>   

Please help me to run my video gallery
thanks in advance,special request to UncleCheese


26 January 2010 at 3:04am 4085 Posts

That's weird.. You explicitly say "no control needed", but then you put it in a control (???)

Try just $Video


<% control Video %>$Player(width,height)<% end_control %>


26 January 2010 at 3:40am (Last edited: 26 January 2010 3:41am), Community Member, 97 Posts

I am sorry typing mistake..the actual code was
<% control Video %>
<% end_control %>

in the page .ss

I have also tried
<% control VideoThumbnail %>$CroppedImage(50,50)<% end_control %>

but no result,
when I have tried your given code i,e
<% control Video %>$Player(300,200)<% end_control %>

i got title,description and then


but nothing is showing up.

thank you in advance


26 January 2010 at 3:54am 4085 Posts

You might be misunderstanding..

If you just run $MyFLVComponent (in your case $Video), it will run the forTemplate() function on that object. I the case of an FLV object, that will return Player($defaultWidth, $defaultHeight);

So you do not need <% control Video %> in that case. If you use <% control Video %> you're looking for the $Video component ON your Video component, which of course doesn't exist.

Alternatively, you can step into the component using <% control Video %> and then run any number of functions that are in the FLV class, including $Player, $VideoThumbnail, or $VideoPopup.

Therefore your second example of having $Player in the Video control is correct. If you're just getting a "loading" message, you need to check for Javascript errors and make sure "dataobject_manager/code/flv/swfobject.js" is in your source and that the swfobject.embedSWF() function is running correctly.


26 January 2010 at 8:02am Community Member, 97 Posts

thanks a lot UncleCheese,its really nice of you have taken so much pain to explain me how to use the FLV functions.
I have tried all your suggest code,but it seems nothing is working.The file you have mention is also present there i'e

how to check whether the javascript is working corretly,
i ahve tried firebug it does not gives any error,i tried to check the html source of the resultant page and i found that no player is getting embedded..
the html code of the resultant page is

<!-- template D:/wamp/www/cs_login/themes/blackcandy/templates/ -->
      <div class="link">
         <div class="description">
         <div class="resource">
<div id='player-1'>Loading...</div>


<!-- end template D:/wamp/www/cs_login/themes/blackcandy/templates/ -->

I tried to find our in FLV.php page
i may be wrong but i have noticed that in this part of code

public function Player($width = null, $height = null)
      if($width === null) $width = self::$video_width;
      if($height === null) $height = self::$video_height;
//this line

            "swfobject.embedSWF('%s','player-%s','%d','%d','9.0.0','expressInstall.swf',{file : '%s'},{allowscriptaccess : 'true', allowfullscreen : '%s'})",
// this line
      return "<div id='player-".self::$player_count."'>Loading...</div>";

the above 2 points line are not working or may be either of this two line
and self::$player_count part in particular.

ANY suggestion??
thank you once again


26 January 2010 at 8:42am 4085 Posts

At this point, I'd really need a public link to the site to be able to do further testing. It's something really simple, I'm sure.


26 January 2010 at 3:00pm (Last edited: 27 January 2010 6:19pm), Community Member, 97 Posts

thank you UncleCheese
here is the link of the site..

and this is the page it is showing 2 mp3 and 3rd one is a flv


26 January 2010 at 4:47pm 4085 Posts

Umm.. your page has no header or footer. It starts with <div id="primaryContent">. Without a body tag or a head, how can you expect javascript to work?

Looks to me like you put your template in the wrong directory. Should probably be in /Layout, don't you think?

Go to Top