I updated to the last 5.x-1.x-dev from February 11, did the database update, and now my older video nodes (mostly YouTube) no longer show the player. What's worse, if I try to edit the node, I don't get any fields, not even Body. The body text is still there, shows up in teaser and full mode, but without the player. Fields not related to video (Log, Author, Menu, etc.,) are still there. Adding new video nodes seem to work OK.

Is there some configuration that I still have to do? There seems to be some nice changes in this version, which will make it easier for me to post YouTube videos, but of course not at the cost of losing all my previous videos.

Is there a way for me to revert to the previous version, if I've already done the database update?

Thanks for any help!

Comments

fax8’s picture

please check that you have all the helpers module enabled. Look for them in the video group in the module admin.

Fabio

fax8’s picture

There is a bug in the db updating code in video.install on video_update_5().

The newly introduced vtype field is not being set on existing video nodes.

This is what we should have in place of the TODO line

1 - Select all values from the vidfile field from the video nodes where vtype == "" (see note below)
2 - For each of them compute the correct value for vtype field
something like _video_get_filetype($vidfile) of the old version can be used. This will discriminate between googlevideos, youtube and others.
In case of other, if the user have video_upload enabled consider them as uploads, if not as url videos
3 - store the computed data back in db

NOTE: As we might have a huge number of nodes this could time out.. then is probably better to put this computation into another video_update_N function. Then I think that the user could call the update.php script more than once and this should assure that the process complete.

Any help on fixing this one appreciated.

Fabio

CosmicVoyager’s picture

I've enabled all the helper modules and looked through all the config options without success. Even if this was a problem, it doesn't explain why I can no longer edit my current videos. In the old version there were options to show the video inline or in a tab; these options no longer seem to be there.

Under "Flash settings" the default entry is "FlowPlayer.swf". I don't have this file, and am assuming that this is not needed to show YouTube videos. Is this the case?

fax8’s picture

The new version always put the video player inline. This is why you don't have that option anymore.

The broken update function above doesn't set the vtype field correctly. This field is now crucial because depending on it's value the video module call the corresponding helper.

Without this field correctly set the video helpers are not called and you are not able to edit correctly the old video nodes.

Instead creating a new video node should work.

dshaw’s picture

I have the same problem too. Can you tell me what the possible values for the vtype field are. I only have a few video nodes so I can manually enter them via phpMyAdmin or similar. It would appear that that would be enough to solve this problem.

fax8’s picture

the vtype values can be: google, link, upload, url, youtube.

Just remember to enable the associated plugins on the modules admin.

CosmicVoyager’s picture

I have hundreds of video nodes, and they are practicallly all from YouTube.

Is there a mysql query I can run from phpmyadmin to properly update the nodes?

dshaw’s picture

If I didn't have the associated plug-ins enabled before I upgraded do I need to enable them now?

What is the meaning of each vtype value? google and youtube are fairly obvious, but the others are not clear.

For videos I uploaded myself, either .flv or .wmv, I'm guessing their vtype will be upload?

So I tried this. I set the vtype = upload for all my videos. I also enabled the 'upload video' and 'video ffmpeg' modules. Now my videos give me an error message: "Video type not supported". In my case they are ".flv" and ".wmv". They both played fine before. How do I get them to play now?

dshaw’s picture

CosmicVoyager: a simple SQL statement would be:

update `video` set vtype = 'youtube';

NB: This will change all your video nodes to youtube. To be more selective, you need a WHERE clause. Also, if you're using a DB table prefix, you'll need to change 'video' to '<prefix>video'.

CosmicVoyager’s picture

dshaw: that SQL statement worked, thanks! Well, sort of. I am now able to edit my nodes again. However, the video still wouldn't show, and I found that I had to convert my YouTube URLs from (for example) iyB7ljHjsJY to http://www.youtube.com/watch?v=iyB7ljHjsJY. Is there some SQL magic I can use to patch all my nodes at once, or will I have to go through them one at a time?

Thanks for all the great help!

CosmicVoyager’s picture

Title: Older video nodes does not play, cannot be edited » Older video nodes do not show player, cannot be edited
dshaw’s picture

I can't think of an easy way to convert your URLs for your youtube videos. You could do a select to extract them all, then edit the result to produce a bunch of SQL statements.

However it seems like a bug that you have to specify the youtube.com bit now. It would be better for all that info to be in the video module.

Anonymous’s picture

subscribing

fax8’s picture

You might want to try this query:

update video set vidfile=concat('http://www.youtube.com/watch?v=',vidfile)

NOTE 1: the above query will be executed on all your video nodes. so don not use it if you have other kinds of video type than youtube.

NOTE 2:always remember to backup your DB before doing such operations.

fax8’s picture

@dshaw #12

We changed the UI of the video_youtube form to require the user to insert the youtube URL.

User now can simply copy and paste the url into the form without having to look for the youtube video id. Better for the user isn't it?

Then we have to store the whole url as the user, once reediting an existing youtube video, will expect to find what he inserted on the video creation.

Interested in hearing if you have better ideas.

dshaw’s picture

You make a fair argument re the youtube URL.

Can I get an answer to my problem in comment #8?

fax8’s picture

in reply to #8: please post here the content of the vidfile for those videos.

New version of the video module have plugins which enable different kind of video types. The vtype db field is expected to let the module know which kind of video type we have in order to load the appropriate plugin.

Then the vtype value is completely related to the video_* modules..
google: a google video
youtube: a youtube video
url: a video created inserting the url
upload: a video created uploading a video

Sorry.. there isn't a link one.

dshaw’s picture

SQL: select vidfile from video;

Result:

files/video/FSoT.flv
files/video/TheMoment.flv
RQ2ekgMEvbo
files/video/wsl-gf.flv
files/video/Highlights-2006.wmv
files/video/Highlights-2005.wmv
files/video/Highlights-2002.wmv
files/video/Highlights-2007.wmv

So there's one youtube and 7 uploaded videos. I've set vtype to 'upload' for them all. The 'Upload Video' module is enabled. And none of them will display the video.

vhmauery’s picture

Status: Active » Needs review
StatusFileSize
new3.64 KB

Try this patch. I am so sorry about committing the changes without doing the database update. I guess I was just a little bit too excited about the new stuff.

Here is a patch that seems to update most of my videos. For some reason it doesn't seem to work with youtube videos, but it does work with url videos, upload videos, and google videos. Please give it a shot. It shouldn't hurt if it is run more than once (like if you have too many videos and the update script times out and needs to be run again).

fax8’s picture

Title: Older video nodes do not show player, cannot be edited » update functions for correctly set new vtype
Status: Needs review » Needs work

Nice work Vernon.

I did not try your patch yet, however seems that you miss the youtube vidfile changes introduced in the new version. See #10, #14, #15 above.

Note: Changing issue title as all the problems are related to the incorrect update functions and we are already at a patch level.

fax8’s picture

always remember to do database backups before testing new code and patches

xav’s picture

Hi,

so I tried the SQL snippet: update `video` set vtype = 'upload'; because I only have *.flv videos, but I obtained the dreaded "Video type not supported" as a result. As I'm a bit wary of trying the patch directly, is there something I can do in the DB to make it work ?

Thanks,

Xav

xav’s picture

BTW, there's something really strange: I executed that request::
select vidfile from video;

And some of the entries come out like:
http://parateam.com/system/files/videos/liberta.flv
whereas the others come out empty. In both cases I don't understand:
- why some local flv files come out with a fully-qualified URL ?
- why some others are empty ?

I would have expected all of them to look like files/liberta.flv ...

vhmauery’s picture

Status: Needs work » Needs review
StatusFileSize
new3.91 KB

Okay, from my testing, the order to do things is this:

  1. make a backup of your database and filesystem
  2. Install new video code
  3. (apply the patch I attached here until it we are sure it is working and gets committed)
  4. run update.php. If you have lots of videos and the script times out, it should be safe to run it again. Make sure that you run it from the same level as you did before (I think it should be run from version 5).
  5. go to admin/build/modules and enable all the video types you have. If you don't have any new video types that aren't already selected, you must still hit 'Save Configuration' because the paths to the type modules have changed with this upgrade.
  6. watch your videos
xav’s picture

Aaargh .. of course, I tried this but I skipped step 1 ...
Here's what I got:

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"%youtube.com/watch%' at line 1 query: UPDATE video SET vidfile=CONCAT("http://www.youtube.com/watch?v=",vidfile) WHERE vtype="youtube" AND vidfile NOT LIKE "%youtube.com/watch% in /home/parateam/public_html/includes/database.mysql.inc on line 172.

Despite this error, the videos seem to work (I haven't tested them all, but the few I tested work again).

Thanks,

Xav

vhmauery’s picture

StatusFileSize
new3.91 KB

Xav,

Right. It looks like I had a quoting error in the sql. Okay, that is fixed in this patch. Note that that error only affected youtube videos, so if you didn't have any of those, you can safely ignore the messages you saw.

vhmauery’s picture

Status: Needs review » Fixed

I inadvertently committed this latest patch when committing the change to http://drupal.org/node/221323 so I am marking this as fixed. If there are any other update issues, you can go ahead and open a new issue for that since I think we have a good hold on setting vtype, which is what this issue was really originally about.

dshaw’s picture

I followed the detailed steps (above) including the latest patch. The contents of the database at the end look ok. I've got values for vtype of 'upload' and 'youtube'. I've enabled several video modules (including params, upload, youtube, custom fields, url). But unfortunately, no joy. I get "Video type not supported" errors and when I edit the video nodes, only two fields appears under "Video Information" and one under "HTML object parameters". No other fields are present to help me manage settings like file size and so on.

SQL: select * from video;

vid nid vidfile videox videoy size download_counter play_counter video_bitrate audio_bitrate audio_sampling_rate audio_channels playtime_seconds download_folder disable_multidownload use_play_folder custom_field_1 custom_field_2  custom_field_3 custom_field_4 custom_field_5 custom_field_6 serialized_data vtype

273 273 files/video/FSoT.flv 480 360 11830151 1 210 0 0 0 233 0 0 a:1:{s:9:"video_fid";N;} upload
274 274 http://www.youtube.com/watch?v=RQ2ekgMEvbo 425 350 1000000 0 92 0 0 0 12 0 0 a:1:{s:9:"video_fid";N;} youtube
Anonymous’s picture

Status: Fixed » Active

I have just installed the latest version of video (5.x-1.x-dev (2008-Feb-19)), which I think includes the latest patch. Unfortunately, it does not seem to work for me. All newly uploaded videos ("newly" meaning uploaded after the new module version was installed) work fine. The old ones, however, do not work.

Not working means:
a) videos are not played and there is no information indicating that there even is one, just the body text of the node
b) if you edit one of these old videos, there is no "Video Information" - no URL in case of a youtube video, nothing about upload path etc. and also no body

This applies to uploaded videos, youtube videos and to videos linked in from other websites - no difference.

I have checked the database and all the videos, new and old, do have a "vtype" set (either "url", "youtube" or "upload").

Any ideas? For test reasons I switched back to the old video module I used before (from last year) but that is not working either...

Anonymous’s picture

Additional comment as dshaw has posted his sql result I thought I'd do the same as our problem seems similar:

Result: select * from video
vid	nid	vidfile	videox	videoy	size	download_counter	play_counter	video_bitrate	audio_bitrate	audio_sampling_rate	audio_channels	playtime_seconds	download_folder	disable_multidownload	use_play_folder	custom_field_1	custom_field_2	custom_field_3	custom_field_4	custom_field_5	custom_field_6	serialized_data	vtype
282	282	http://www.youtube.com/watch?v=nU8DcBF-qo4	320	240	0	0	121	0	0	0		3171		0	0							a:1:{s:3:"iid";s:0:"";}	youtube
438	438	http://redress.lancs.ac.uk/resources/Sermon_Paul/Puppeteers_Performers_Avatars/paul_sermon.wmv	720	576	155189248	0	0	0	0	0		1785		0	0							a:1:{s:3:"iid";s:0:"";}	url
439	439	http://redress.lancs.ac.uk/resources/Magnusson_Thor/thor_magnusson.wmv	720	576	1782411427	0	0	0	0	0		2749		0	0							a:1:{s:3:"iid";s:0:"";}	url
437	437	http://redress.lancs.ac.uk/resources/Dipple_Kelli/Remote_Exchanges_and_Collaborative_Working_Methods/dipple_high_speed_network.wmv	720	576	185597952	0	1	0	0	0		2636		0	0							a:1:{s:3:"iid";s:0:"";}	url
776	776	http://www.arts-humanities.net/system/files/videos/intimacy5.mov	320	240	146074117	0	0	0	0	0		780		0	0							a:1:{s:3:"iid";s:0:"";}	url
844	844		320	240	24117248	0	0	0	0	0		360		0	0							a:2:{s:3:"iid";s:0:"";s:9:"video_fid";s:4:"1619";}	upload
993	873	http://www.youtube.com/watch?v=x2NQiVcdZRY	425	350	0	0	0	0	0	0		0		0	0							a:1:{s:3:"iid";i:872;}	youtube
fax8’s picture

well.. the above values seems just fine.. and I created a video entry on my testing server with the values from the nid 282 above and it worked just fine..

Is this website publicly available? You can use my contact tab from my profile to send me the URL outside the tracking system.

Anonymous’s picture

The website is no secret: http://www.arts-humanities.net and http://www.arts-humanities.net/video for the videos. However, you will not find much useful stuff there - I needed to get the videos working, so I just deleted the old nodes and uploaded the files again into new nodes and it all seems to work smoothly now.

What I find interesting though, and this may or may not be a clue to what happened, is that the (newly) uploaded files do not show up in the video table:

1011 891 800 600 0 0 0 0 0 0 0 0 0 a:2:{s:9:"video_fid";i:1647;s:3:"iid";s:0:"";} upload

This is one example - the vidfile column is empty for all uploaded files but has content (a url) for all the videos that are located on other servers, youtube etc. In dshaw's example, the vidfile column has the filename on his server. So I guess there is something odd either in his or my video table...

jorisx’s picture

I've also got the same issue, so I'm subscribing to this tread
(old thread here: http://drupal.org/node/221009)
my problem is that the vtype's for the old video's which were uploaded in flv format are not set with the upgarde

any help would be appreciated :)
keep up the good work !

yopyop’s picture

also subscribing. I have a old videos that don't play, and are not editable, same as comment #29. I just uploaded the March 5 dev version of video module, to see if it would fix it. Is it possible to revert back to an older version of video? I think database changes have been made in the mid-february version of the video module..

dshaw’s picture

There's some more info in a related issue that might be relevant.

You should be able to revert to an older version of video - just swap in the old code. I did this quite often while issues were being resolved with the new stuff. The new version added a new column to the video table in the DB. This column is simply ignored by the old version. (So you don't even have to remove it.)

fax8’s picture

@yopyop: you might want to try this: backup your DB, run update.php but select video module update number as 5.

fax8’s picture

Status: Active » Postponed (maintainer needs more info)

any feedback about the new code for the updates?

I runt it on 2 websites and it worked as expected.. anyone confirm it is working correctly now?

CosmicVoyager’s picture

Everything is working fine for me.

fax8’s picture

I'm talking about the update process from old versions (pre February 08) to the current one. Did you run it successfully?

CosmicVoyager’s picture

Yes, all my nodes updated without problems. I only have YouTube videos, though.

fax8’s picture

ok.. anyone updated on all kind of nodes?

Carlos Miranda Levy’s picture

I had the same problem. The videos were not showing and there was no edit field after upgrading. It turned out to be a simple step required after upgrading.

Go to -- admin / build / modules -- look for the Video section and enable the other components that are new in this version (Youtube video, google video and URL video) which were not separate components in the older version.

Developers should add a note in the README.txt or instructions for upgrading.

yan’s picture

My uploaded videos didn't play neither, although they had the right vtype set ("upload"). I changed it to "url" and now it seems to work.

iLLin’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)