Hi All,

It will be nice to hear from maintainer if module is in active development, I've seen issues assigned fixed recently, but not closed and no comments from developers will proposed patches ever made to the trunk.
Despite that, there is another patch :-)
What it does:
1. Supports more then one mp4 video sources with different targets (iPhone 2G/3G, iPad, iPhone4, etc) by assigning different compatibility profiles when resolution available from Video module or fallback to default profile when not.
2. Poster frame (thumbnail) from the first video source if Video module available
3. Fallback to flowplayer (flowplayer has to be installed in drupal's "libraries" folder). I reviewed #976400: No Flash fall-back patch, but did not like neither use flowplayer API module nor how it was executed (I felt implementation of the Flowplayer API module needs some more thoughts to match theming of the VideoJS). So I coded it directly into template file for now.
4. Description is available in template, but needs placing implementation.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

batourine_m’s picture

Forgot to mention - it also fixes the situation when field does not have value.

bcobin’s picture

Gosh - this looks like it could be a big help - I'm having no luck at all with getting the player to work on mp4 or flv files.

Sorry to show my ignorance here, but I'm not sure how to work with the diff files - would it be possible to supply a patch? (Although I'm sure you created diff files for a reason.)

Looking forward - thanks!

heshanlk’s picture

Status: Needs review » Patch (to be ported)
heshanlk’s picture

Tested by myself

bcobin’s picture

Tested by myself

Cool... I'll wait for the patch. Standing by...

batourine_m’s picture

Well, I can do patch, but against 1.1 version right now.
1.2 introduced ImageField based poster and to make it compatible, I'll have to make an admin settings option to choose where to get poster - custom field or Video module.
Also, as I already mentioned - in 1.2 flash play back is based on the LAST mp4 or flv, which usually not the intent when the content you want by default is first in the list.
I'll produce the patch and you'll decide should it be incorporated or not into the dev trunk.

patrickroma’s picture

subscribe

bcobin’s picture

I'll produce the patch and you'll decide should it be incorporated or not into the dev trunk.

@batourine_m: Thanks for responding! But heshan.lk is "da man" (da woman?) when it comes to making decisions here! I'm just a poor slug trying to make my sites mobile-compatible.

Thumbnails are super-important, so personally, I don't think it makes sense to roll back. I also may not be understanding completely everything that's going on here with HTML5, so I'd like to take the opportunity to pose a quick question:

As I understand it, the main issue here is that iPods and iPads won't play Flash. They will play mp4s directly, though, without need for a Flash player. So, I'm under the impression that the challenge is to let mp4s play directly on the problematic device(s) sans a Flash player, while letting FF, Safari and IE play the MP4 through a Flash player like JW5.

If I'm correct here (and I'm sure I'm missing something), this would mean that all you'd need to do is encode whatever video you have into mp4 and the system would do the rest. Do I have this at least partially correct?

Anyway, thanks for all the work you're doing here - as mobile devices proliferate, this is of paramount importance, IMHO. You developers are my heroes - rock on and thanks again!

batourine_m’s picture

FileSize
13.97 KB

New patch to 1.x dev sources.

1. Configurable in admin settings for the module which field will be used for thumbnails per content type or fallback to video module if present.
2. Multi-resolution mp4 files with different profile capabilities for graceful fallback to compatible video sources by less capable devices
3. Flash modules fallback - if swf or flowplayer present - use it, otherwise fallback directly to the web version of flawplayer
4. video/flv priority for Flash fallback, otherwise FIRST mp4 to play - (permits to have old FLV files in the field for compatibility with old sites with old videos uploaded)
5. Cleaner template files by moving php logic out of template file into pre-processing functions. Small fixes for flowplayer api regarding class requirements for videojs.

To @bcobin - Idealy all mp4/ogg/webm files will be played by VideoJS scripts through native browser capabilities (Safari, FF 4x beta, Chrome) with fall back to no-script version for iphone,ipad and fallback to Flash player for the browsers who can't play HTML5 videos like (FF 3.x, IE 7x-8x)

My vision to do next - is to embed VideoJS patch I've seen on the developers website to have a choice - which resolution to play - like Youtube - 240p,360p,480p,720p

bcobin’s picture

@batorine_m: you rock.

Friday will be "tech day" around here and we'll be digging in - I notice the JW 5.4 player (which seems to work if renamed in accordance with SWF Tools JW4 configuration) claims to be HTML5-friendly, so this might be preferable to Flowplayer (or "flawplayer," as you wrote!) ;-)

Looking forward to testing this... wow. Awesome work!

bcobin’s picture

Took me a while to get to this - I had to fall back to alpha version of Video module because mp4 encoding fails on my system with current Video dev.

Applied patch to jsVideo dev version - in no particular order:

1. VideoJS thumbnails settings aren't accessible.

2. On FF, thumbnail appears and dims - no player is loaded. I have both .flv and mp4 versions of the video encoded. Behavior is the same whether SWF Tools, Flowplayer or HTML5 Player is selected for .flv files.

3. On Safari, mp4 (HTML5 Player selected) loads with Quicktime player instead.

So while the video plays for iPhone and iPad, playback on Safari is not what it should be and on FF it doesn't work at all. So it looks like no solution yet for video to play across all platforms. (Tears fall like rain...)

Hope this helps!

batourine_m’s picture

For number #1 - list is populated by checking presence of extra filefield in the content type where videojs widget is enabled or Video module enabled.
I did not test it with most recent rc release where VideoJS was embedded into Video module (embed code is based on the 1.2 release of VideoJS which I don't like much) - that is where the problem could be. Thumbnail settings is testing all filefields which has videojs as widget to show page. The most recent Video module with integrated VideoJS functionality could have same widget name. As soon as on of the filefield detected, the content type is scanned for extra filefield types which can be used for thumbnails. If video module enabled it is added.
So, if you are using Video module with embeded html5 support (most recent one) - it might not going to work. Or as minimum you'll need assign VideoJS widget from VideoJS module, not html5 widget from Video module.

I read you comment again - and it does seems you are using html5 widget - not videojs widget from this module - "HTML5 Player selected".
BTW - assigning widget is done not on Video module settings but on content-type->Display Fields page for the proper filefield. And it should be named "VideoJS: HTML5 video player"

If you do everything right and VideoJS widget is selected, next step to troubleshot will be disabling Flowplayer API or SWFTools modules - patch will fall back to web version of the Flowplayer. I don't have nither Flowplayer API nor SWFTools modules installed, therefore did not test it, used provided examples on how to invoke them if they are present.

bcobin’s picture

Thank you so much - that is immensely helpful! (This whole process has been incredibly confusing...)

I'm determined to get this to work - after all, if you're not "mobilized" these days, you're behind the curve. I'll be digging back in on Sunday - have a great holiday!

OK - finally got to this today and unfortunately, the player doesn't seem to work in any configuration here - I set the output of the content type to the jsVideo Player as per instructions, disabled SWF Tools and Flowplayer API - there was an empty tag in all configurations. This is using Video 4.2 Alpha2. Oh well...

If you actually have it working on your end, perhaps a step-by-step walkthrough would be useful? Thanks for your work here...

batourine_m’s picture

Can you give the url to the page you are testing on? I would like to see generated content.

batourine_m’s picture

Hi bcobin,
First of all - your widget was set to video (video module), not videojs (videojs module), I changed it to videojs display widget (/admin/content/node-type/video/display/basic)
As soon as I changed it videojs module settings shows proper thumbnail options (not empty as it was when no videojs widget was selected but video as videojs widget selected and video module enabled).
Second, your video is mpeg format not mp4 or flv, which can't be played by html5 and fallback to flash player is questionable.
I increased limits for videos per field to 2 from 1 and adding mp4 file - should work, but it is taking awhile to save a node - seems there is some kind of translation/transcoding is involved.... I finally saved the node by clicking off "bypass auto conversion". Enjoy the video.
Your video problems - your widget was not video-js and your video was not html5 of flash compatible (it was mpeg format, not mp4,ogv or webm for html5 or mp4/flv for flash fallback)

bcobin’s picture

batorine_m:

Thanks for taking a look... much appreciated!

First of all - your widget was set to video (video module), not videojs (videojs module), I changed it to videojs display widget (/admin/content/node-type/video/display/basic)
As soon as I changed it videojs module settings shows proper thumbnail options (not empty as it was when no videojs widget was selected but video as videojs widget selected and video module enabled).

Yes - I had left the test site set to SWF Tools playback so the client could view, knowing that you'd be able to change it - as you did!

Second, your video is mpeg format not mp4 or flv, which can't be played by html5 and fallback to flash player is questionable.

In Edit, the node shows the pre-processed file (which is indeed an mpeg); what you were unable to see without access to the filesystem are the converted files, which the system is playing - both an mp4 and flv. The system is playing back the processed files, not the uploaded mpeg file, so this is as it should be.

I increased limits for videos per field to 2 from 1 and adding mp4 file - should work, but it is taking awhile to save a node - seems there is some kind of translation/transcoding is involved.... I finally saved the node by clicking off "bypass auto conversion".

I have both mp4 and flv conversion happening, which (I think) should cover all cases, but takes a while to transcode. (I haven't yet tweaked the flv conversion settings, which are too hi-fidelity and create flv files that are too large.)

The file that you uploaded plays in Safari (with HTML5 player) and on my iPhone simulator (with Quicktime), but it doesn't play in FF. I'm assuming the player is playing the uploaded, non-processed mp4 file for Apple, but it doesn't seem that the Flash fallback is working for FF. Another question would be what happens if a user uploads a video that's other than mp4. It looks like there'd be no playback in FF in any case, which is consistent with #12.

I think if we could figure out what's happening here with FF, there may be a cross-platform solution - I will leave the sandbox on the rest of the evening in case... many thanks!

UPDATE: After looking into this further, it looks to me that with the suggested configuration, the player is looking at the files/video folder for output, and not the files/video/converted folder by going directly to the jsVideo player in CCK - and thus bypassing Video entirely. When used this way, the player will never "see" the converted files and, yes, it will play an mp4 file if it's uploaded without encoding, but that's not a solution for cross-platform video from different file types using FFMPEG.

Also, in looking at the SWF embed code, it appears that the player is looking for the mp4 file, which won't work in FF regardless.

Rolling back to the (unpatched) dev version of the jsVideo player, iPhone (and I would assume, iPad) works using Quicktime (meh), Safari works using Quicktime (not optimal - SWF Tools would be better here for embed capabilities, etc.) and FF shows the thumbnail (which it finds correctly), but doesn't play the Flash video because it's looking for the mp4 file instead of the flv file as I mentioned above.

So I'd say the first thing would be to look at the Flash fallback for the module and have it look for an flv instead of an mp4.

On an additional note, I think the best solution here might be to look at the latest JW Player (5.4), which is supposed to be HTML5 compatible. Back to the drawing board... thanks!

batourine_m’s picture

mp4 is acceptable format for flash and plays fine by flash player when fallback happens.
You issue that video filefield contains original mpeg instead converted mp4 and flv files - this is video module issue, not the video-js module.
I'm not sure about video module ability to transcode one upload into two formats at the same time and it is video module should provide transcoded video in the filefield, in your case it provides an original mpeg file.
I checked your site again, but could not do much - you reverted to non-patched version of video-js

On the good side - I found some bugs in fallback to flash code - that means if I fix them - it might start to work in firefox.

As summary - transcoding issues are completely in the video module area. This module (videojs) is only presentation. I would split your efforts into two tests:
1. make video module transcode properly and store transcoded videos in the multivalued field. As minimum - transcode into mp4 properly.
2. as soon as you have one mp4 and/or one or more supplemental formats (ogg, webm, flv) in the filefield you can test playability.

bcobin’s picture

mp4 is acceptable format for flash and plays fine by flash player when fallback happens.

Yes - it's the fallback that's not properly happening, it seems. FF has a problem with mp4 - see here:

https://developer.mozilla.org/En/Using_audio_and_video_in_Firefox

Note the section where it says, "Since Firefox doesn't support MP4 and 3GP due to their patent-encumbered nature, the elements with the IDs "mp4_src" and "3gp_src" will receive error events before the Ogg resource is loaded..."

You issue that video filefield contains original mpeg instead converted mp4 and flv files - this is video module issue, not the video-js module.

That's actually not the case - while the node will indicate the uploaded file in Edit mode (which is an mpeg), the module actually plays the transcoded files. I've now patched the module again and set the output (from Video, not CCK) to HTML5 player - you should be able to see with the "Another test video" that it is, indeed, the mp4 file that the player is finding, although it won't play it in FF.

I'm not sure about video module ability to transcode one upload into two formats at the same time

Yes, it does.

and it is video module should provide transcoded video in the filefield, in your case it provides an original mpeg file.

Actually not - see above. You can't see the filesystem, but in using two presets, Video does, indeed, create both the flv and mp4 files in the converted folder. (Again, the file the node indicates in Edit is the uploaded file and is immaterial to the output.) I've now set the Video output to the HTML5 player and by using Firebug, you should be able to "see" the transcoded mp4 file, although it won't play. Insofar as the Flash fallback doesn't work, you won't be able to see the flv file, but I assure you, it exists in the converted folder.

It's worth noting here that in no circumstance does the actual HTML5 player instanciate. iPhone and Safari use Quicktime and FF doesn't play at all. I haven't yet looked in IE - first things first.

1. make video module transcode properly and store transcoded videos in the multivalued field.

You just need one field for the upload file - the Video module does the rest and plays the converted files, not the uploaded file.

1. As minimum - transcode into mp4 properly.

Yes, I am. I would mention here that this is using one-pass encoding with a custom command string, not the presets. The presets are two-pass encoding and that's not working here - but that's another issue. The encoding is, indeed, working.

2. as soon as you have one mp4 and/or one or more supplemental formats (ogg, webm, flv) in the filefield you can test playability.

As I mentioned before, there are the two files in the converted folder - flv and mp4. You can try yourself, but I'd advise using a very small test file.

On the good side - I found some bugs in fallback to flash code - that means if I fix them - it might start to work in firefox.

That's great news - I see issues with mp4 playback in Firefox which can be "fixed" with addons, but I'm deliberately running "vanilla" installations over here so as to ensure the average user won't have problems.

Hope all this helps - I think we may be almost there... thanks much!

bhosmer’s picture

@bcobin, thanks for the heads up on this! This module fits exactly what I need - if it would only work. I can say that IE has the same issues as Firefox, since I was testing that as well.

To add, I have used this module without the video module, added an mp4, ogg, and webm from the mediafront site and still have not been able to play in firefox or ie.

Safari and Chrome work fine for me.

I also have experienced this same issue using Mediafront module as well.

mcfilms’s picture

This is such an incredibly complex issue. Multiple media containers using multiple codecs. I have found there is a big difference between mp4 files that use the h264 codec (they work) and others that do not. For example, if I render an animation out of After Effects as mp4, it will not play under videojs and a closer inspection will reveal the codec to be "mp4". If I re-compress it, the file will be playable by videojs.

The site I am working on now, http://takefivemethod.com uses the videojs code (not the module) for all video playback. I am hard-coding the thumbnails, videos and players using the full path. And I am STILL having trouble. Currently the animation on the home page plays across all Mac platforms, on iDevices, on PCs running Firefox and most PCs with IE. But I have found a few problems with IE on the PC. (Yes, I know, shocking.) The full collection of videos on the "take 5" link do not play on Explorer either. By the way, I am using only H264 and Flash fallback.

This is all in lieu of simply saying "subscribe" and to point out that if @heshan.lk and @batourine_m get this to work across all platforms, they are truly Drupal Heroes.

bhosmer’s picture

Do ogv files work for you? Isn't that one of the components needed since firefox and ie don't do mp4?

I have set my file fields with mp4's, ogv's, and even webm's and even still it doesn't work.

I echo mad props to @heshan.lk and @batourine_m and anyone else working on this. I wish I could do more, but my php isn't up to it.

mcfilms’s picture

I do not use ogv. It's notoriously hard to encode on the Mac and I don't want to support a third codec. Firefox and ie get the FLV version of the video.

bhosmer’s picture

Ok, got it. I was considering doing the same thing.

bcobin’s picture

If anybody has this actually working where transcoded Video can be played across the different major platforms (FF, Safari, iPhone, iPad/iPhone, IE), I think detailed step-by step documentation would be very useful.

This is how I understand it- and please correct me if I'm missing something:

Two types of encoding should be sufficient - I would say mp4 and Flash. Here's how I would expect things should work:

1. Video content type full node output should be set to Video and players should be selected in the Video module settings - both mp4 and FLV should be set to HTML5 player.

2. User uploads a video file in any of the FFMPEG-supported formats.

3. System transcodes the file into both mp4 and FLV versions, which end up in the "converted" folder. (For me, this works with Alpha2 video, but not with dev versions and only if the two-pass preset commands are replaced with a one-pass command. If there's a specific setting for filefield path for the content type to get two-pass encoding to work, this should be documented.)

4. HTML5 player should play mp4 on Apple (using the HTML5 player) and use Flash fallback for FF and IE. This should cover all the major platforms.

Again, please correct me if I'm wrong here; regardless, I think there should be a well-defined "vanilla" workflow we're all shooting for so the intrepid developers can see exactly where the process fails.

As an additional note, the current JW Player (5.4) claims to support HTML5, so this may prove to be an alternate solution.

Thanks for all the time everybody is putting in here - hopefully we're close!

mcfilms’s picture

@bcobin -- You don't mention thumbnail generation which can come from a few places. It can be from another uploaded file, automatically selected at a predetermined time from the video stream using ffmpeg, or selected from the video in some other way.

I think you are mistaken when you say "both mp4 and FLV should be set to HTML5 player." My understanding is that you want to use a Flash player for the FLV. The video.js hands off the playback to a player like JW player or FlowPlayer. You need this because not all browsers support HTML5.

Also, although you and I might be happy with a simple mp4/flv solution, I think some purists want to provide a true open-source solution. That's why a pretty much lame and under-supported video container like ogg vorbis is even in contention. The folks at Mozilla (Firefox) really want you to use it. Some developers want their open source to be open source.

There is also the issue of multiple bandwidth profiles. It sure would be nice to have the option, sometime down the road, to deliver 400kbps to slower connections and 800kbps (or more) to faster ones.

I'm all for getting a plain vanilla player out as soon as possible. I just think the task at hand is much more complex then it seems at first glance. I think the days of uploading a single FFMPEG-compatible stream to a site, choosing a thumbnail and delivering a cross-platform video presentation are still many months off.

bhosmer’s picture

My work-flow for this module now is slightly different. In fact, I think the intention of the module is that it is a standalone module that only requires filefield to work.

I am using it without the video module at all, and it works for MP4 in safari, chrome, and ios, but not firefox on windows or os x.

After enabling the module, I added a video upload field using fielfield to my content type.

I have added so many different file type combinations hoping to troubleshoot this module. 1) MP4/OGV/WEBM 2)MP4/OGV/FLV 3)MP4/FLV as an upload in my filefield.

I then change the display for the file to "VideoJS"

I have been using the videos from mediafront, Big Buck Bunny just to make sure my encoding wasn't the issue.

I have also been trying the Mediafront Module and I have managed to get it to work with MP4/FLV as intended. The maintainer claims that this is what they are using on their front page. OGV's won't play in firefox, but the mediafront module does play the MP4/FLV combination.

This issue may have something to do with the video for everybody, since VideoJS relies on that.

This module fits perfectly for what I want to do: Have a universal player that works in the four big browsers and is ios compatible as well and I suspect this is the intention.

The main issue I see is with firefox really, but I don't know where to begin to track it down.

bhosmer’s picture

Category: feature » bug
bhosmer’s picture

I may have just had an eureka moment here. When I started looking into the video for everybody page, I saw a mention of needing to add the mime type to your .htaccess file.

Like this:

AddType video/ogg .ogv
AddType video/mp4 .mp4
AddType video/webm .webm

After doing that, it now seems the module works!

There still isn't a flash fall-back though.

batourine_m’s picture

Status: Patch (to be ported) » Needs review
FileSize
14.56 KB

New patch
All work was around fallback.
I found that not all combinations of " and ' works when php template rendered.
Also replaced object notation of fallback to object/embed combination - should be more compatible with older FF on windows platforms (FF of Mac seems just "object" is enough).
Most modifications were for sites where nither swftools nor flowplayer api modules are not enabled - pure fallback to web version of flowplayer 3.2.5 directly from their website.

Also on the side note - fallback to flash is very dependent on poster/thumbnail image. it should exist and be downloadable. Otherwise flowplayer throw 303 Resource not available error due to the poster/thumbnail image is first to play in the playlist.

batourine_m’s picture

btw url I'm testing:
http://www.daniels.utoronto.ca/research/projects/green_roof/green_roof_c...

I tested it on IE, FF for Mac, Safari - plays HD (Safari as html5, IE and FF as Flash)
iPhone4, iPad plays HD
iPhone 2g/3G/3GS plays 640x480

bcobin’s picture

Very exciting! Looks like you put in a lot of work in here, batourine_m - the green roof site is working nicely!

Not able to get it going on my system, though - a few questions:

1. Is the patch applied against release 1.2 or dev? (I tried patching both and it seems to apply on either.)

2. It looks as if you're uploading your mp4 directly and bypassing the Video module entirely; is that the case? (I don't see a "videos/converted" path, which would seem to indicate you're uploading your files directly. This would not be a solution for uploaded video from a variety of different file types.)

I'm using Video and have both mp4 and flv players set to HTML5 player, using Video as the output for the CCK Video file type. The output is the same as originally described - no HTML5 player instanciation in any case, QT output for Apple and no output in FF. When I set the CCK output to HTML5 player, just an empty tag is generated where the video is supposed to be. I'm using already-encoded files, so they may just be in the wrong place.

If you have the player working directly, it looks like it may not be integrating properly (yet) with the Video module.

Many thanks for everything you're doing here and also, thanks to those participants on this thread - onward!

dcaillibaud’s picture

I applied the patch #30 on the 6x-dev version (2010-Dec-01) without patch pb, but then I have an error on node submit "Could not display the flash because sites//files/http:///sites//files/ does not appear to exist."
(before enabling this patch dev version, I disabled and uninstalled my 6x-1.2 version)

In source code (page http://test.numecia.fr/node/26) I have
- param base is set to http:///sites//files/
- video src is http:///sites//files/the_right_movie.mp4
and also, in the video tag, I have poster="http:///sites//files/">, but thumbnails are in http:///sites//files/video_thumbs/26 (because node 26, video_thumbs is choosen in /admin/settings/video/transcoders)

bhosmer’s picture

Wow, awesome stuff.

miaoulafrite’s picture

hi everybody and thanks a lot for all your work so far.
i'm also trying to make it work and then add my contribution.

i'm particularly interested in how to set the fall-back to a specified player
a test video can be seen here: http://vod2.elephorm.com/node/30384
it has been uploaded manually and therefore i guess no thumbnail has been generated. anyone has any idea how i could explicitly specify the thumbnails? via imagecache for example?

batourine_m’s picture

@bcobin - your site is down - can you instal devel module - I would like to see node structure when video is converted (not just uploaded).
@dcaillibaud - can you confirm that it is working just with video module while video-js is not enabled?
@miaoulafrite - you are using un-patched version (see patch in #30), in un-patched version you have to have field_poster of type filefield with thumbnail loaded into. if you want automatic thumbnail from video module - you'll need to apply patch.

batourine_m’s picture

@miaoulafrite - it does seems not only un-patched but also 1.1 version - which does not have fallback and triple video sources (bug)

bcobin’s picture

@bcobin - your site is down - can you instal devel module - I would like to see node structure when video is converted (not just uploaded).

Okey dokey. Up like a pup. Thanks!

batourine_m’s picture

@bcobin
I checked module video internals and what info is available through standard node interface - not good news...
Converted videos are not exposed as a node object properties :-( I'm not sure why - I would guess - conversion to the multiply formats is a new feature and not everything developed yet.

I suspect it will be easier to port video-js directly into video module (this will give access to internal structures of it...) - @heshan.lk already ported 1.2 version into 4.2alpha2 video module.
I'll see how easy it will be for me to call video module routines to get transcoded videos...

bcobin’s picture

@batourine_m,

You are a true superstar. This is precisely the sort of information that's necessary to get all this to work.

The good news (and good news it is) is that once you and/or other intrepid developers out there are able to solve this issue, it should mean relatively seamless conversion and display of video across all platforms - no mean feat!

Thanks for taking the time and for all the work you're doing here... amazing. Thank you!

miaoulafrite’s picture

@batourine_m thanks a lot, i missed the update.

i can't get the patch to work... here is the error i get:

can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -rupN original/includes/videojs.admin.inc new/includes/videojs.admin.inc
|--- original/includes/videojs.admin.inc	2010-10-31 10:25:03.000000000 -0400
|+++ new/includes/videojs.admin.inc	2010-12-15 16:22:34.000000000 -0500
--------------------------
File to patch: 

about the fallback, it is still not happening (but i understood it shall be in the patch) : now in FF there are no more controls (play, ...) but only a cross in the middle.
is there any special code i need to write somewhere to explicitly show the fallback? we use a custom player.
url of a video played with the videojs module: http://vod2.elephorm.com/node/30384
url of a video played through flash: http://vod2.elephorm.com/photographie/formation-lightroom/apprendre-phot...

bhosmer’s picture

The maintainer replied to this thread and said this module isn't meant to be used with the video module.

I pointed him/her to this thread as well and mentioned the issues with flash fall-back.

batourine_m’s picture

@miaoulafrite
download videojs, unpack it
download patch, put it into videojs folder

cd videojs
patch -p1 <videojs.patch
miaoulafrite’s picture

@batourine_m
thanks a lot, the patch was applied successfully.

patching file includes/videojs.admin.inc
patching file includes/videojs.theme.inc
patching file theme/videojs.tpl.php

i did try with -p and -p0 before, and without success. i'm not that used to patch, what is the difference? what means -p1?

however, there is still no fallback as you can see http://vod2.elephorm.com/node/30384

bhosmer’s picture

@miaoulafrie: I viewed your site in Firefox and it looks like you only have an MP4.

I think the intention of this module is that you add an MP4 and an OGV and then a flash-fallback just in case those don't work.

Are you trying to go with just an MP4 and have a flash-fallback for everything else?

batourine_m’s picture

@miaoulafrite - try to disable swftools module - what happens?

miaoulafrite’s picture

@bhosmer > yes, it is only mp4 in the link i provided. most of the videos of this site are from mp4 files. i would like to read them directly when possible, and have a fallback when no browser player is available.

@batourine_m > there is a custom flash player on this website, that i would like to use as fallback. it is based on swftools (see again this link). how could i set the fallback to this player? it will probably be necessary to hack this module a lilttle bit, but i have no idea where and how. do you have any suggestion?

bhosmer’s picture

@miaoulafrite I may be reaching here, but have you tried just adding an .flv along with your .mp4?

This is my understanding of how the module works. You need each type of video present in your node, and then videojs plays whatever the browser wants.

batourine_m’s picture

FileSize
14.6 KB

Hi All,

In order to have fallback there are two prerequisites:
1. video should be playable by flash - mp4 is fine. (flv is not a requirement, but will have priority if present)
2. when video-js scripts detect non html5 browser it will look for html element with "vjs-flash-fallback" class inside the video element, as soon it found, it will dynamically put "vjs-flash-fallback" element in-place of video and pack video as the last element of "vjs-flash-fallback".
Something like that initially:

<video class="video-js">
  <object class="vjs-flash-fallback"><embed></embed></object>
</video>

After detecting non-html5 browser elements reconstructed like:

<object class="vjs-flash-fallback"><embed></embed>
  <video class="video-js">
  </video>
</object>

in your case I see object/embed elements generated but without class "vjs-flash-fallback", I suspect that is why it is failing with swftools enabled.
I did some digging to find-out how to pass a class to the swf() - not much documentation and I don't want to deploy all the set of swftools related code on my site.
I generated another patch - found in one paragraph mention that class can be passed in 'othervars' array - reapply attached patch - might work :-)

miaoulafrite’s picture

@bhosmer > yes, the more files you have, the better. on this site there are tons of videos, and having each node multiplied by the amount of necessary files (mp3, flv, ogg, whatever) will necessitate an incredibly high storage capacity. this is why i would like to keep only one video file per node.

@batourine_m > thanks, this is exactly the information i expected! i did apply the new patch. the video is still not being played BUT there is a mention made to the player swftools-wrapper elephormplayer-mediaplayer

batourine_m’s picture

FileSize
14.68 KB

I hardcoded flashfallback code with surrounding div and class vjs-flash-fallback.
Patch attached.

miaoulafrite’s picture

@batourine_m nope: the patch has been applied BUT i got the error

Fatal error: Cannot redeclare _videojs_flashplayer() (previously declared in /srv/www/vod.elephorm.com/drupal-6/sites/all/modules/videojs/includes/videojs.theme.inc:109) in /srv/www/vod.elephorm.com/drupal-6/sites/all/modules/videojs/includes/videojs.theme.inc on line 205

so i reverted the last patch.

bcobin’s picture

batourine_m,

Wow - thanks for all the work you're doing here - that's a lotta code!

Still not working here, though - I'll go through a few things here to try to track down what's happening:

Conditions:

a.) A successfully-transcoded test video from Video alpha4 release where there are both mp4 and flv files with the same name (and the appropriate file extensions) in the sites/default/files/videos/converted folder.

b.) Setting for filefield path in Video module is blank.

1. Disabled and de-installed jsVideo dev.

2. Successfully patched jsVideo 6.12 (release version) with patch from #49 and installed same.

3. Set Video output to Video in CCK, in players for the Video module, I select HTML5 player for both mp4 and flv. Result: same as described in #12, above. (Perhaps this is as expected if Video JS: HTML5 Video Player needs to be selected as output in CCK.)

4. Set Video CCK output to Video JS: HTML5 Video Player. Result: no video output at all.

(batourine_m: Note that if you look at the sandbox site, Video will usually be set to SWF Tools for client review purposes.)

Hope this helps - thanks!

batourine_m’s picture

@bcobin
It is not going to work for you - I can't figure out how to get converted videos through normal drupal interfaces.
Field values keeps only originally submitted files. Converted videos are exists as internal structure of the video module :-(
There has to be a little more work on both modules - video and videojs so one can use information from another.
For integrated HTML5 player from video module - as much as I noticed - it has pretty poor implementation and handling of flash fallback... But I don't want to touch video module - complicated and unfinished (as you noticed) - I would like to see acceptance of the current patches in the videojs and ether porting them as a whole into video module or making converted videos to be available through normal means of cck and used by videojs...
I can say - I'm waiting for the next video release to see the direction developers will go so not to invent bicycle 1000 times :-)

@miaoulafrite
You seems applying patch on the already patched source - one of the functions of the patch is adding _videojs_flashplayer() function to the module. So when you apply patch second time it will add it again.
Get the original module and apply patch.

bcobin’s picture

batourine_m: Thank you so much for your most excellent summation of the Video situation as it currently stands, not to mention all the work you've been doing! I'm hopeful that it will lead to a comprehensive video solution across all platforms - it looks like you've done a lot of the heavy lifting here and I am most grateful, as I'm sure are many others. Keep up the good work and rock on!

bhosmer’s picture

After trying the patches, I am getting this error:

warning: Invalid argument supplied for foreach() in /sites/all/modules/videojs/includes/videojs.theme.inc on line 34.
warning: Invalid argument supplied for foreach() in /sites/all/modules/videojs/includes/videojs.theme.inc on line 75.

This is from a block view.

Edit:

If I make the style unformatted and then the row style node, it seems to eliminate the error.

miaoulafrite’s picture

@batourine_m > thanks a lot for all the help and support you provide. i did reinstall the module and applied the last patch, but still nothing is being played in FF. and now, there is no mention to the player in the html source

any idea?

batourine_m’s picture

@miaoulafrite
Are you sure? You site: http://vod2.elephorm.com/node/30384 plays just fine in my Firefox 3.6 and IE8 - flash fallback is working :-)

miaoulafrite’s picture

oh my god yes! you are right!
thanks a lot!

which player is used then?
PLUS
how about thumbnails : since files are already uploaded, how can we create thumbnails ?

batourine_m’s picture

Two options:
1. You choose which imagefield field to use for the thumbnails
2. Use video module autogenerated thumbnails

It is in the Video-JS module settings page.

miaoulafrite’s picture

@batourine_m

option1 is new in the module administration page. cool. Is there any support of imagecache?

if i prefer option2, can you please describe how i should proceed?

miaoulafrite’s picture

@batourine_m > are you still there?

batourine_m’s picture

yep - i'm around, busy with booking modules ;-)
For thumbnails from video module - not much to configure.
Just make sure that in Thumbnails section of Video-JS configuration page the "Video module" is chosen for your video field.
In Video module configuration - assign - automatic video thumbnail generation.
With the patch, Video-JS module will check for the presence of the thumbnail in the node structures.

I found that you have to resave nodes sometimes - video module is pretty unstable and sometimes video thumbnails are generated and saved in one folder, but node structures show different path.

miaoulafrite’s picture

okay thanks a lot, i'll check that

rmjackson’s picture

Subscribe

jrb’s picture

FileSize
642 bytes

After applying the patch in #51, Firefox was still not working correctly. I was getting the error "200, Stream not found" in the Flash player. This ended up being due to the code not finding the poster image. I fixed this by changing the line in videojs.theme.inc that sets the poster image. Patch is attached (make sure to run the patch in #51 first).

gabiroba’s picture

OK, where is my issue. I maybe duplicating questions. First, I'm not sure if it is a issue with Videojs module or Views slideshow.

I'm using Views 3 alpha and Views slideshow beta (last one). I'm in Drupal 6.

I installed Videojs module and after patching as described in this post I achieved the firefox display (not tested on IE). So, I'm trying to create a view with thumbnails. OK, thumbnails are there but no chance with the second node display wich has no alignment and no video, just sound.
Thumbnails were created manually since I don't have permissions to FFMPEG working on my server.

My setting are row style: node

Style: slideshow with pager as thumbnails.

gabiroba’s picture

OK,

After lots of trials I'm receiving this error:

warning: Illegal offset type in isset or empty in /mysite/includes/form.inc on line 2290.
warning: Illegal offset type in /mysite/includes/form.inc on line 2294.

It happened after flowplayer installation and some tries to patch the problem with foreach () in line 18 when we chose fields style videojs: HTML5 in Views.

Even when I got original code back in theme.inc, the error does not disappeared.

Any suggestions?

Thanks.

gabiroba’s picture

Sorry for so many posts. I think I solved my problem of carousel nodes with video by using Slider Module.

The other error describe of illegal offset type is still present.

And, I'm not sure I have installed flowplayer correctly because instructions on the page are not so clear. So IE yet to be tested

Thanks for your patience.

miaoulafrite’s picture

@bastourine_m> seems that the video is not played on iPad where HTML5 is okay on Chrome for example. any idea? is there any difference between HTML5 on Chrome and on iPad?

bhosmer’s picture

It worked for me on an ipad and an ipod touch. Did you upload an mp4 using an h.264 codec?

miaoulafrite’s picture

@bhosmer > yes. videos of this site are h.264
if you have an ipad with you, give it a try: http://vod2.elephorm.com/node/33497 and http://vod2.elephorm.com/node/30384

miaoulafrite’s picture

@bhosmer > i tried on an iPad yesterday. both videos above failed. i got a crossed play button which did not allow me to launch the video.
this symbol is probably the result of a specific cause. do you know which one?

batourine_m’s picture

@miaoulafrite it is definitely mp4 problem - I can't play video even if I upload your mp4 directly to the ipad. Something wrong with encoding of it.

miaoulafrite’s picture

@bastourine_m > thanks a lot. what could be the reason for this? how can i investigate?

bhosmer’s picture

Here is the mp4 I used to test it when I was working on it: http://www.bigbuckbunny.org/index.php/download/

I think it is actually included with dash or mediafront.

miaoulafrite’s picture

here are the characteristics of one of the videos i proposed (not the ocean one):

Duration: 00:00:28.53, start: 0.000000, bitrate: 859 kb/s
Stream #0.0(eng): Audio: libfaad, 22050 Hz, stereo
Stream #0.1(eng): Video: h264, yuv420p, 1280x800, 15.00 tb(r)

it does not mean a lot to me. can anyone help me. it is mp4 h264 so it should be played... or?

bhosmer’s picture

@miaoulafrite: Did you confirm you have the mimtype set in your .htaccess file? Did you try the bigbuckbunny mp4? Also, doesn't the audio need to be aac?

miaoulafrite’s picture

the .htaccess file was not modified.
i just added the 3 lines mentioned above:

AddType video/ogg .ogv
AddType video/mp4 .mp4
AddType video/webm .webm

i did not try the bunnyvideo yet it is really big. audio needs to be aac?

bhosmer’s picture

Yes, I believe the audio needs to be AAC as well. The bunny video is a great video for testing this module, since you can then rule out encoding problems. That is the video I used to troubleshoot and I was able to finally play in all four browsers, an ipad, an iphone and and ipod touch 2nd and 3rd generation.

miaoulafrite’s picture

okay for audio
one of the video i proposed has been taken from the videojs site, which should be encoded properly
it is this one: http://vod2.elephorm.com/node/30384

i will check out the bunny video as well. thanks for your support and advices

heshanlk’s picture

Status: Needs review » Fixed

Added to the dev

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.