The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Sun Apr 29, 2012 2:51 pm 
Joomla! Intern
Joomla! Intern

Joined: Mon Oct 03, 2011 6:13 pm
Posts: 56
Hello,

i use the plugin JPlayer for joomla to embed videos on my website. All of my videos are in .mp4 format, you can see an example here: http:www.equipolr.es

They work fine in pc computers and android phones, but don't work with my iPhone.

I looked around and found out that iOS doesn't support flash (which i find incredible!!). But it does support html5. Then i looked for a clever player that would play both flash and html5 and it seems that the JWPlayer does that.

Now the JPlayer is based on the JWPlayer so now i don't understand why my videos don't play in my iPhone.

I thought that maybe the JPlayer was limited.

So i tried the free JWPlayer module to see if it would work on all platforms. But no, same thing. With the difference that with the JWPayer module, my video doesn't appear but there is a link to download the flash player. But flash isn't supported by the iOS. To play on iOS it has to be in .m4v format or .mov.

My question: if i put both .mp4 and .m4v files in my video folder, is there a way to embed the video with JWPlayer or JPlayer that would play the .mp4 file on pc and android, and play the .m4v file on iOS?

Or is there any other way to assure that my videos are working fine on all platforms?

Thank you in advance for your answer!!


Top
 Profile  
 
PostPosted: Sun Apr 29, 2012 10:01 pm 
User avatar
Joomla! Champion
Joomla! Champion

Joined: Thu Aug 18, 2005 2:09 am
Posts: 5154
Location: California
.
The JW Player in the JPlayer extension is a SWF which has no built-in HTML5 fallback.
That HTML5 support comes from the load of JavaScript included with newer versions of the JW Player.
But you do not need all their commercially branded crap just to do an HTML5 fallback.

You also do not need multiple types of files.
iDumb devices can play MP4 just as well as M4A (which is an MP4 format file).

But be aware that higher encoding profile levels in the MP4 may not be supported in the iDumb devices.
Then you may want to use different files.
The higher quality encoding supported by Flash Player.
And the lower quality encoding supported in the iDumb devices.
So it depends on the encoding profile used in your original MP4.


It should be possible to simply add an HTML5 <video> tag fallback to the JPlayer plug-in MP4 file embed code.
The tag embed codes are found in the sources.php file.

Around line 79 you will find this:
Code:
"mp4" => '
<object type="application/x-shockwave-flash" width="{WIDTH}" height="{HEIGHT}" data="{SITEURL}/plugins/content/jplayer/mediaplayer/player{PLAYERVERSION}.swf">
   <param name="movie" value="{SITEURL}/plugins/content/jplayer/mediaplayer/player{PLAYERVERSION}.swf" />
   <param name="quality" value="high" />
   <param name="wmode" value="{TRANSPARENCY}" />
   <param name="bgcolor" value="{BACKGROUND}" />
   <param name="autoplay" value="{AUTOPLAY}" />
   <param name="allowfullscreen" value="{FULLSCREEN}" />
   <param name="allowscriptaccess" value="always" />
   <param name="flashvars" value="file={SITEURL}/{FOLDER}/{SOURCE}.mp4&image={SITEURL}/{FOLDER}/{SOURCE}.png&autostart={AUTOPLAY}&fullscreen={FULLSCREEN}{FLASHVARS}{PLUGINS}" />
</object>
',


Add the HTML5 <video> tag fallback code in the <object> tag fallback position right before the closing </object> tag:
Code:
"mp4" => '
<object type="application/x-shockwave-flash" width="{WIDTH}" height="{HEIGHT}" data="{SITEURL}/plugins/content/jplayer/mediaplayer/player{PLAYERVERSION}.swf">
   <param name="movie" value="{SITEURL}/plugins/content/jplayer/mediaplayer/player{PLAYERVERSION}.swf" />
   <param name="quality" value="high" />
   <param name="wmode" value="{TRANSPARENCY}" />
   <param name="bgcolor" value="{BACKGROUND}" />
   <param name="autoplay" value="{AUTOPLAY}" />
   <param name="allowfullscreen" value="{FULLSCREEN}" />
   <param name="allowscriptaccess" value="always" />
   <param name="flashvars" value="file={SITEURL}/{FOLDER}/{SOURCE}.mp4&image={SITEURL}/{FOLDER}/{SOURCE}.png&autostart={AUTOPLAY}&fullscreen={FULLSCREEN}{FLASHVARS}{PLUGINS}" />
   <video poster="{SITEURL}/{FOLDER}/{SOURCE}.png" src="{SITEURL}/{FOLDER}/{SOURCE}.mp4" width="{WIDTH}" height="{HEIGHT}" controls="controls"></video>
</object>
',


If you want to use different source files (MP4 for Flash Player and M4A for iDumb devices),
in the <video> tag you could change the file extension on the SRC parameter from MP4 to M4A.

I did not test this, but it should work.
On the iDumb devices it should fallback to the <video> tag.

Let us know how it goes.
.

_________________
██ AllMedia4Joomla Project
██ http://sourceforge.net/projects/allmedia4joomla/
██ AllMedia YouTube Feed Gallery module released
██ Download: http://sourceforge.net/projects/allmedia4joomla/files/


Top
 Profile  
 
PostPosted: Mon Apr 30, 2012 8:48 am 
Joomla! Intern
Joomla! Intern

Joined: Mon Oct 03, 2011 6:13 pm
Posts: 56
Hello Kenmcd,

i did as you said: i added the HTML5 <video> tag fallback code in the <object> tag fallback position right before the closing </object> tag.

IT WORKS PERFECT!!

Now all of my videos play perfectly on iDumb ;-) devices!

I can't believe that it was that simple. I was seriously thinking about buying that commercial JWPlayer in order to have my vids work cross-platform, while it could be solved with just one more line in the embed code!!

Thank you very much (once again) for your help!!

You are the best!


Top
 Profile  
 
PostPosted: Mon Apr 30, 2012 8:50 am 
Joomla! Intern
Joomla! Intern

Joined: Mon Oct 03, 2011 6:13 pm
Posts: 56
ps: i haven't tested the solution with mp4 and m4A because i am not interested in using twice the space on my shared-server if i can avoid it :-)

And with your html5 solution it works fine!

Thanks again


Top
 Profile  
 
PostPosted: Sun Aug 26, 2012 4:57 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Tue Oct 02, 2007 2:39 am
Posts: 241
Location: Florida
I was searching for this solution also. I have added the video tag to the file, but I don't have iphone, or ipad for testing. I will let you know if all goes well.

Or if someone here would like to test the url is http://rockataracademy.com
video is on the right side of home page.
Note this is not a responsive site or that mobile friendly of a page IMO, I am just concerned with video working for iphone or ipad people first.
It does work on my android mobile phone, but it always worked on that.

Thanks for the simple solution kenmcd, and the excellent description on what to do and why.

George


Top
 Profile  
 
 Post subject: iPhone 4 Simulator page
PostPosted: Sun Aug 26, 2012 7:38 am 
User avatar
Joomla! Champion
Joomla! Champion

Joined: Thu Aug 18, 2005 2:09 am
Posts: 5154
Location: California
.
It appears to be set-up properly.
I tested on Firefox with Flash disabled and it displayed the Firefox HTML5 <video> tag error message.
"Video format or MIME type is not supported."
That is to be expected as Firefox does not support playing MP4 in a HTML5 <video> tag.

But, this does confirm the fallback to the <video> tag is working as expected.
So ask one of your friends with an iDumb device to test for you.
Should work.


I also tested your page on the iPhone 4 Simulator page (http://iphone4simulator.com/).
But the only thing I learned is the simulator page does not handle the HTML5 <video> tag properly.
And it defaults to Flash – which makes no sense as the iPhone does not support Flash.
When I disabled Flash in Firefox it just showed an error.
So the simulator page is good for testing the mobile template/layout, but not HTML5 media.

.

_________________
██ AllMedia4Joomla Project
██ http://sourceforge.net/projects/allmedia4joomla/
██ AllMedia YouTube Feed Gallery module released
██ Download: http://sourceforge.net/projects/allmedia4joomla/files/


Top
 Profile  
 
PostPosted: Sun Aug 26, 2012 8:25 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Tue Oct 02, 2007 2:39 am
Posts: 241
Location: Florida
kenmcd, thanks so much for taking a look at it and for providing the code I needed in the first place. I will have someone test it in the morning.


Top
 Profile  
 
PostPosted: Mon Aug 27, 2012 3:00 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Tue Oct 02, 2007 2:39 am
Posts: 241
Location: Florida
It was confirmed to me today that the video plays great over iPad and iPhones. Thanks again for such a fast and excellent solution.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 



Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group