New Module Multimedia w/ Byte Range support for ipod/ipad/iphone

suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2012-02-17 04:55

New Multimedia Module replaces flashvideo and mp3audio modules into one single module supporting HTML5 Audio/Video w/ flash fallback where possible.
This module also adds BYTE RANGE requests for iDevices like the iPhone/iPad...
Get it here.

@see demo and format support here.

Please keep all discussions/feature requests regarding this module in this thread.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Sat, 2012-02-18 07:58

Nice

--
dakanji.com

 
leonki

Joined: 2010-12-18
Posts: 32
Posted: Sun, 2012-04-01 03:02

tried your demo site on iPhone 3GS - mp4 doesn't play but does on flash player website demo. Any idea?

Also, hope you don't mind but im modifying a local copy to play videos from S3 if copy exists there .. Much more usable for big home videos.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2012-04-01 13:50
Quote:
tried your demo site on iPhone 3GS - mp4 doesn't play but does on flash player website demo. Any idea?

nope. but consider the 3GS has reached its life expectancy.
I had to dig my wife's old one out, dust it off, recharge it just to confirm your findings.
MP4 has to be baseline encoded for android, maybe the old 3GS does not like that.

Quote:
Also, hope you don't mind but im modifying a local copy to play videos from S3 if copy exists there .. Much more usable for big home videos.

The beauty of open source.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
leonki

Joined: 2010-12-18
Posts: 32
Posted: Sun, 2012-04-01 15:50

3GS, 4, 4S or iPAD .. doesn't matter .. most important thing is the OS .. and I'm running iOS 5.1 (latest) and it doesn't work. It just shows me the first image (same as thumbnail) with a don't download grey icon on top of it..

I'll try it out on my iPAD as well.. do you have an iOS device that you recently checked with to confirm it works?

 
leonki

Joined: 2010-12-18
Posts: 32
Posted: Sun, 2012-04-01 16:42

OK.. did some more testing.

Your demo site shows .mp4 video on iPad and iPhone 4 .. but not 3GS.

The flowplayer demo site does some the video on 3GS, same as 4 (i.e. open a new window in full screen). iPad shows video in place on the html page.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2012-04-01 17:28

My friend has an old ipad1 and along with my wife's iphone4 is what I originally tested on.
I don't care much about iphone3. I updated it to IOS 5.x and it still does not play any of the videos on my test site - not even the .mov
My Galaxy tab plays most of them and my wife's iphone4 plays all the mp4 derivatives(mp4, m4v, f4v, mov)

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
leonki

Joined: 2010-12-18
Posts: 32
Posted: Mon, 2012-04-02 04:22

BUG REPORT:

In modules/multimedia/classes/MultimediaRenderer.class:

The generated Javascript for the video player should be modified to include the "scaling" option. The correct source should look like this:

clip: {
url: '%s',
scaling: 'fit'
}

This will preserve the aspect ratio of videos when switching to full screen mode. Encoding my 1080p home movies shows strange vertical stretch when going full screen on my MacBook Pro. With this feature, slight black bars are visible above and below the image.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2012-04-02 12:13

Thanks
Strangely I had it in my local copy but not my production copy.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2012-04-02 14:10

BTW, I have an updated mediaBlock w/ compatibility for the new multimedia module.
Examples

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
leonki

Joined: 2010-12-18
Posts: 32
Posted: Wed, 2012-04-04 00:16

I had a blast the last couple of days hacking around with this module .. here's some fun stuff I did for my own site (which I host from a server at home to family over my DSL):

- moved from using flowplayer to jw player (not going to start a holy war here, enough to say it does a better job for me)
- added code to identify client - if on same network as server, serves files from server, otherwise checks S3 to see if file found there, if so, serves file from S3
- by default, forces HTML5 and falls back to Flash (as HTML5 video supports streaming) - chrome, ipad, iphone
- Flash fallback doesn't go to S3, but rather goes to Amazon CloudFront which enables streaming from S3 using flash - firefox, ie

In the end of the day, the user experience for videos is amazing! Always fast, and always starts playing in 1-2 seconds, no matter what browser you use or where you're located. It's always fast, even with my 1080p home videos.

Thanks for creating such a great module, that finally solved my home video sharing problem, which I had for the last 5+ years.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2012-04-04 02:23

Glad I could help w/ your video issues.
In my testing mp4 won out w/ the widest support. All devices could play via <video /> or flash.

I'm disappointed that webM did not have better support as the codec has awesome compression/performance.
Even my android tablet could not play it natively - even running android 4.0.3 ICS - maybe some day.

As for Jeron's player vs.Flowplayer - potato/potatoe

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
leonki

Joined: 2010-12-18
Posts: 32
Posted: Wed, 2012-04-04 23:04

When you say mp4, I assume you mean h.264 .. as some of these files are called mp4, sometimes m4v and rarely now .avi

In any case .. you're right. I use HandBrake to convert my huge 1080p dumps to something streamable in h.264 format with AAC audio (as most 1080p video devices capture AC3 audio instead)

As for G2 vs G3 (I know it's a touchy subject for you) I think I truly understand the issues better, now that I had a chance to do some G2 development. In my opinion (take it with a grain of salt) G3 was a step in the wrong direction. Sure G2 is slower, but it's only slower on machines that are a couple years old. On a modern i7 server, G2 is just as fast as G3. In addition, bandwidth is getting faster and cheaper. I think the effort to recode G3 could have been better used in improving G2.

If anything, the image firewall in G2 makes things like swapping video in/out (depend on client location, client browser, size of video file, time of day, etc) is much much easier. I actually converted my G2 installation to G3 **TWICE** (and we're talking about 20,000+ images on an old P4 server! LONG LONG TIME) In both cases, it rubbed me the wrong way and I went back to G2.

Thanks again for the great module.

 
irwand

Joined: 2008-06-10
Posts: 4
Posted: Thu, 2012-08-16 18:16

Thank you suprsidr!! I've been looking for a solution to get videos just play on wide variety of devices. Your solution is the best/easiest I've come across on Gallery2.
It would be awesome to get your module be a part of the standard distribution, replacing the flashvideo. Especially now that flash is being killed.

 
davidarnoult

Joined: 2008-03-18
Posts: 39
Posted: Tue, 2012-09-04 13:23

Hi,

This module looks pretty good, thanks suprsidr! However it seems that it does not work in embedded G2 mode in Drupal 6.
Works fine in stand alone. I have this error in the player : 200 Stream not found, NetStream.Play.StreamNotFound, Clip:"[Clip " http://mywebsite.com/f/6633/2010.flv?g2_GALLERYSID=87987987987987989879879".
Other thing : the administration panel for this module does not appear (such as flashvideo module works fine).
URL rewrite is activated in Drupal + gallery2. Any idea?

URL de Gallery = http://www.mywebsite.com/gallery2/main.php
Gallery version = 2.3.2 noyau 1.3.0.2
API = Noyau 7.54, Module 3.9, Thème 2.6, Intégré 1.5
PHP version = 5.3.14 cgi-fcgi
Serveur Web = Apache/2.2.X (OVH)
Base de données = mysqli 5.1.49-3-log, lock.system=flock
Boîtes à outils = NetPBM, Gd, ImageMagick, SquareThumb
Accélération = none/21600, none/21600
Système d'exploitation = Linux web602.media.ha.ovh.net 3.2.2-grsec-mutu-grs-ipv6-64 #1 SMP Thu Jan 26 14:55:34 UTC 2012 x86_64
Thème par défaut = matrix
gettext = activé
Langage = fr_FR
Navigateur Web = Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.75 Safari/537.1
Lignes dans la table GalleryAccessMap = 1210
Lignes dans la table GalleryAccessSubscriberMap = 18721
Lignes dans la table GalleryUser = 80
Lignes dans la table GalleryItem = 18721
Lignes dans la table GalleryAlbumItem = 1336
Lignes dans la table GalleryCacheMap = 0

Thanks...

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2012-09-04 13:42
Quote:
URL rewrite is activated in Drupal + gallery2. Any idea?

did you check the box next to the multimedia option in Gallery admin -> rewrite?

Are gallery's rewrite rules getting written to your embed application's .htaccess?

Quote:
Other thing : the administration panel for this module does not appear (such as flashvideo module works fine).

there aint no admin panel for this module

-s
All New jQuery Minislideshow for G2/G3

 
davidarnoult

Joined: 2008-03-18
Posts: 39
Posted: Tue, 2012-09-04 14:43

Yes indeed. I have also added/adapted these lines to the drupal .htaccess

Drupal htaccess
RewriteCond %{THE_REQUEST} /gallery/f/([0-9]+)\-([0-9]+)/([^/?]+)(\?.|\ .)
RewriteCond %{REQUEST_URI} !/index\.php$
RewriteRule . /gallery2/main.php?g2_view=multimedia.DownloadItem&g2_itemId=%1&g2_serialNumber=%2&g2_fileName=%3 [QSA,L]

g2 htaccess:
RewriteCond %{THE_REQUEST} /gallery2/f/([0-9]+)\-([0-9]+)/([^/?]+)(\?.|\ .)
RewriteCond %{REQUEST_URI} !/gallery2/main\.php$
RewriteRule . /gallery2/main.php?g2_view=multimedia.DownloadItem&g2_itemId=%1&g2_serialNumber=%2&g2_fileName=%3 [QSA,L]

But with no results. Still same error. Weird... Still works fine in stand alone. I will check in log files, it is for sure a rule that does not work ;-)
For info working stand alone url is http://www.mywebsite.com/gallery2/gallery/v/videos/2012/2012-0006.flv.html.

Thanks anyway

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2012-09-04 14:58

url pattern in rewrite: m/%itemId%-%serialNumber%/%fileName%

.htaccess:

    RewriteCond %{THE_REQUEST} /m/([0-9]+)\-([0-9]+)/([^/?]+)(\?.|\ .)
    RewriteCond %{REQUEST_URI} !/gallery2/main\.php$
    RewriteRule .   /gallery2/main.php?g2_view=multimedia.DownloadItem&g2_itemId=%1&g2_serialNumber=%2&g2_fileName=%3   [QSA,L]

-s
All New jQuery Minislideshow for G2/G3

 
davidarnoult

Joined: 2008-03-18
Posts: 39
Posted: Tue, 2012-09-04 19:45

Thanks very much suprsidr! That did the trick with /m/*. Btw by default the rewrite rule was wrong (/f)for multimedia module, I didn't modify anything... I have left flasphayer module installed.
Cheers and keep on developing excellent add on for G2 which doesn't want to die and do an excellent job compared to G3!

Thanks

David

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sat, 2014-01-18 14:26

Comments are now permitted for this topic.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sat, 2014-01-18 14:28

If you're having troubles w/ apostrophes in titles:
modules/multimedia/classes/MultimediaRenderer.class line 82 add:

$title = smarty_modifier_markup($item->getTitle(), 'strip');
$title = addslashes($title);

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
boogityshoe
boogityshoe's picture

Joined: 2007-07-14
Posts: 3
Posted: Thu, 2014-04-10 06:33

@suprsidr,

How do I change the default settings so I can turn off the autoplay and set new defaults for various variables described in the AdminMultimedia.tpl file?

I would like the videos to not autoplay. I tinkered with the settings in the MultimediaRenderer.class file, but they do not seem to work.

Thanks,
Tim

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2014-04-10 12:36

Sorry, I never finished the admin for this module. The ~admin.tpl is useless.

In the <video /> element the mere presence of autoplay causes autoplay regardless of it's value.
So <video src="my.mp4" type="video/mp4" autoplay /> would autoplay same with <video src="my.mp4" type="video/mp4" autoplay="true" /> and <video src="my.mp4" type="video/mp4" autoplay="autoplay" /> and <video src="my.mp4" type="video/mp4" autoplay="false" />

Best just to remove the line altogether.

-s
________________________________
All New jQuery Minislideshow for G2/G3