I don't really know how you want to handle my contributions or if you want them at all. There were some things that were broken (or that I didn't understand) on my copy when I tried to use it like the use of url() to get the location of the quicktime movie. I simply changed it to how I thought it should be as just $node->vidfile.

Among the extras, I added permissions groups for 'access videos', 'administer videos', and made an attempt at starting some docblocks.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fax8’s picture

FileSize
19.21 KB

Added support for windows media...

It works with Internet Explorer, Mozilla Firefox + Kaffeine Plugin on Linux.

It doesn't work with Firefox on WIndows.

I need help with this.

deekayen’s picture

FileSize
783 bytes

The two attached objects worked for me by default in IE and Firefox. I had to install the WM plugin for them to work in Opera.

WM Plugin:
http://www.microsoft.com/windows/windowsmedia/download/plugin.aspx

Opera WM plugin install instructions:
http://www.opera.com/support/search/supsearch.dml?index=434

deekayen’s picture

Title: Added .rm, .flv and some extras » video links showing up on non-video screens
Category: support » bug
FileSize
19.94 KB

There also seems to be a problem with video_menu() or caching somewhere. Even after logging out and back in, the very first page has the play and download tab/links on top. if ($node->type == 'video') { in video_menu() makes sense to me for preventing them from showing up on other non-video pages, but that doesn't seem to be the case. Maybe a call to cache_clear_all() in the right place will fix it? Just guessing.

Attached is my most recent version. I think I've done most of the new feature adding I wanted to do, so I should be happy with bug hunting from this point and forking it to audio.module :)

deekayen’s picture

Here are the play and download links in the wrong place. This shot was taken at $base_url.

deekayen’s picture

FileSize
23.02 KB

This version adds a /video callback for listing recently added videos and something I did fixed the earlier bug with tabs on the wrong pages. The earlier tarball I uploaded includes some changes to INSTALL.txt and video.mysql, so this is in addition to it.

deekayen’s picture

The db schema in the video.module I just uploaded is out of date. This is matches the new textfields:

CREATE TABLE `video` (
  `nid` int(10) unsigned NOT NULL default '0',
  `vidfile` text NOT NULL,
  `videox` smallint(4) NOT NULL default '0',
  `videoy` smallint(4) NOT NULL default '0',
  `size` bigint(12) default NULL,
  `clicks` int(10) unsigned NOT NULL default '0',
  `video_bitrate` int(11) default NULL,
  `audio_bitrate` int(11) default NULL,
  `audio_sampling_rate` int(11) default NULL,
  `audio_channels` enum('','stereo','mono') default NULL,
  `playtime_seconds` int(11) default NULL,
  PRIMARY KEY  (`nid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='size is in bytes';
deekayen’s picture

theme_video_play_realmedia() has "classes/" hard coded in a src path of the most recent video.module I uploaded. It played anyway when I tried movies, so I just now noticed it by accident. Fix:

              <param name="SRC" value="'.$node->vidfile.'" ref>
deekayen’s picture

Assigned: Unassigned » deekayen

Committed to CVS.

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

LukeLast’s picture

Version: » master

’ve been noticing this problem of the tabs showing up on the front page with drupal CVS. It used to be the last video node that was submitted (created or edited) would have its play and download tabs show up on the front page. It’s definitely an issue with the cache because clearing the cache table and then refreshing the front page fixes it. With the latest drupal CVS version it seems to be a little better, where I can’t reproduce the problem but it still shows up every now and then. Is anyone else still noticing this problem?

kenwen’s picture

fax8’s picture

Title: video links showing up on non-video screens » video tabs showing up on frontapage
Priority: Normal » Critical
Status: Fixed » Active

the problem of the tabs showing up on the frontpage is also
present on current cvs version (1.16).

I confirm that this is a caching problem.

luke's site show it live now: http://www.ppixel.com/

fax8’s picture

This bug is really hard to reproduce. I wasn't able to do that.
Does anyone knows how can I reproduce it?

I need to reproduce it becouse after reading some drupal docs
I understood that the reason of this bug should be an incorrect implementation
of the video_menu function.

This is the current version (1.16):


function video_menu($may_cache) {
  global $user;

  if ($may_cache) {
    $items[] = array('path' => 'video', 'title' => t('videos'),
      'callback' => 'video_page',
      'access' => user_access('access video'),
      'type' => MENU_SUGGESTED_ITEM);    
    $items[] = array(
      'path' => 'node/add/video',
      'title' => t('video'),
      'access' => user_access('create video'));
    // I don't get this whole goto thing - deekayen 
    $items[] = array(
      'path' => 'video/goto',
      'callback' => '_video_page_goto',
      'type' => MENU_CALLBACK,
      'callback arguments' => arg(3),
      'access' => user_access('access video'));
  }

  if (arg(0) == 'node' && is_numeric(arg(1))) {
    $node = node_load(array('nid' => arg(1)));

    if ($node->type == 'video') {
      if (variable_get('video_displayplaymenutab', 1) == 1) {
        $items[] = array('path' => 'node/'. arg(1) .'/play',
          'title' => t('play'),
          'callback' => 'video_play',
          'access' => user_access('access video'),
          'weight' => 3,
          'type' => MENU_LOCAL_TASK);
      }
      //If the video is of type youtube and multi-file downloads aren't turned on don't show the download tab.
      if (variable_get('video_displaydownloadmenutab', 1) == 1 and (_video_get_filetype($node->vidfile) != 'youtube' or $node->disable_multidownload == 0)) {
        $items[] = array('path' => 'node/'.arg(1).'/download',
          'title' => t('download'),
          'callback' => 'video_download',
          'access' => user_access('access video'),
          'weight' => 5,
          'type' => MENU_LOCAL_TASK);
      }
    }
  }
  return $items;
}

As you can see there are some lines contained into
if($may_cache) {

}
and others outside.
I think that these outside should be moved into an else statement
for the if($may_cache) because without the else also uncacheable
items will be cached.

What do you guys think about it?

Fabio

LukeLast’s picture

Status: Active » Needs review

Good work, this seems to have fixed the one case I could reproduce.

Clear cache, then load "play" page, then check home page. Before the tabs would show up on the home page after doing this, now with the patch they don't.

I've committed the changes to CVS but I'll restrain from changing this to "fixed" until someone else has a chance to test it.

fax8’s picture

Luke:
please add correct caching if and else statement also
to the video.module version for drupal 4.6

I tried it but not luky with cvs... I'm getting:
cvs commit: sticky tag `DRUPAL-4-6' for file `video.module' is not a branch

So please tell me the cvs commands you will use.
Thanks.

Fabio

LukeLast’s picture

Status: Needs review » Fixed

I use Tortoise CVS which doesn't allow commiting to branches, it gives the same error.

Anonymous’s picture

Status: Fixed » Closed (fixed)
fax8’s picture

also commited to DRUPAL-4-6