HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Integrating DEWPLAYER for mpeg gallery items

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#106606 (In Topic #20786)
Avatar

These are basic instructions for replacing Quicktime with Dewplayer for mpeg gallery items

Here is a quick implementation of dewplayer for mpeg gallery items instead of using Quicktime.

Dewplayer does not support HTML5 , it is flash based.

1. Download dewplayer and put it in the most outer folder with your ocPortal installation (such as the www directory)

2. EDIT /sources/galleries.php (WARNING! Save a copy to /sources_custom/galleries.php and edit that instead)

Go to the show_gallery_media function.

FIND
case 'audio/x-mpeg':

ADD AFTER:
case 'audio/mpeg':
$tpl='GALLERY_AUDIO_DEWPLAYER';
break;

FIND:
$tpl='GALLERY_VIDEO_GENERAL';

REPLACE WITH:
if ($tpl == '') { // that's two ' , not a quotation mark
$tpl='GALLERY_VIDEO_GENERAL';
}

SAVE FILE.

3. Log in to ocPortal as an Administrator
4. Go to the Admin Zone.
5. Style -> Themes
6. Edit templates for your theme(s).
7. Create a new template with name GALLERY_AUDIO_DEWPLAYER
8. Add the following into the template, replacing YOURDOMAIN with the URL to the dewplayer folder:

{$SET,player_id,player_{$RAND}}
  <div id="content">
 
  
  <div id="dewplayer_content">
  <object data="(YOURDOMAIN)/dewplayer/dewplayer.swf" width="{WIDTH*}" height="{$ADD,{HEIGHT*},16}" name="dewplayer" id="dewplayer" type="application/x-shockwave-flash">
  <param name="movie" value="(YOURDOMAIN)/dewplayer/dewplayer.swf" />
  <param name="flashvars" value="mp3={URL*}" />
  <param name="wmode" value="transparent" />
  </object>
  </div>
  
  
</div>
 
 
<script type="text/javascript">
var flashvars = {
  mp3: "{URL*}"
};
var params = {
  wmode: "transparent"
};
var attributes = {
  id: "dewplayer"
};
swfobject.embedSWF("(YOURDOMAIN)/dewplayer/dewplayer.swf", "dewplayer_content", "{WIDTH*}", "{$ADD,{HEIGHT*},16}", "9.0.0", false, flashvars, params, attributes);
</script>



What I really want to see ocPortal do is integrate an HTML5 / Flash player for video and audio instead of relying on browser-based plugins which frequently do not work correctly or get blocked.


Last edit: by Patrick Schmalstig
Back to the top
 
Posted
Rating:
#106607
Avatar

I appreciate your instructions above :).

However, we do integrate an HTML5 / Flash player. If you upload mp4 or flv files, jwplayer will be used.

Are you uploading .mpg/.mpeg files? If so you may have used the wrong file extension, as the mpeg container format (as opposed to the mp4 container format) is old now.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#106608
Avatar

can jwplayer play audio files?

Also I meant to clarify that dew player is for the mp3 file format. However the mime-type source code seems to determine mp3 as mpeg, thus why I placed the dewplayer template code for the mpeg mime type

EDIT

Apparently jwplayer does play audio. I just did a test. Instead of using dewplayer directly, I instead used this code for the mpeg type:

if (addon_installed('jwplayer'))
{
$tpl='GALLERY_VIDEO_FLV';
break;
                                } else {
$tpl='GALLERY_AUDIO_DEWPLAYER';
break;
}


Last edit: by Patrick Schmalstig
Back to the top
 
Posted
Rating:
#106609
Avatar

Could it be you just don't have the jwplayer addon installed?

PHP code

        switch ($mime_type)
        {
            ...
            case 
'video/x-flv':
            case 
'video/mp4':
            case 
'audio/x-mpeg':
            case 
'video/webm':
                if (
addon_installed('jwplayer'))
                {
                    
$tpl='GALLERY_VIDEO_FLV';
                    break;
                }
            default:
                ...
                
$tpl='GALLERY_VIDEO_GENERAL';
        }


I'd actually forgotten that it's not a core addon, so could be non-installed on any particular site.

In the code above it flows onto 'default' if jwplayer addon is not installed (because it doesn't break).


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#106612
Avatar

I do have jwplayer installed on my ocportal installation actually. I just don't like the fact it falls to quicktime for mp3 when it probably should use jwplayer if installed. I had a couple people complain they'd rather not use Quicktime to hear my podcasts, so I did this modification so they didn't have to.

EDIT

...so in summary despite jwplayer being installed, it still falls to Quicktime unless I modify the code.
Back to the top
 
Posted
Rating:
#106617
Avatar

Our bad, audio/x-mpeg should be audio/mpeg. We'll get this fixed in the next patch release.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#106618
Avatar

You have both audio/x-mpeg and audio/mpeg as cases in the galleries.php file. And according to mime-types.php , mp3 should point to audio/mpeg. So I'm still stumped as to why by default mp3 falls to Quicktime even if jwplayer is installed.

EDIT

Oh wait sorry I take that back. I must have added it when I put this DEWPLAYER code in. The original doesn't have audio/mpeg


Last edit: by Patrick Schmalstig
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: