Hey Travis,

I want to move the pre/next button into the controllbar so that I can leave the playlist hidden.

You can see my idea in the attachment.

How can I do that? I can't find the code for the pre/next button.

PLease help me.

Yannick

CommentFileSizeAuthor
#6 Player is destroyed7.26 KByannickoo
Player4.54 KByannickoo

Comments

travist’s picture

This functionality is controlled using the jquery.media.pager.js file. This is then added to the playlist statically in the jquery.media.playlist.js file. I am thinking what needs to happen here is I need to modify the code to allow you to dynamically add the pager to the playlist. Then, you would just make your controlBar also a pager, and then add that to the playlist using some simple code. I will work on this, since it shouldn't be too hard to implement, and I think it would add a lot of value.

Thanks for the suggestion.

Travis.

travist’s picture

Status: Active » Needs review

Just checked in a way to do this.... After you get the latest DEV ( ready tomorrow ), you should now be able do write something like this in JavaScript on your page.... The following assumtions are made...

  • Your preset name is mypreset
  • Your controlBar Id is <div id="mediafront_mypresetmediacontrolbar">......</div> ( which drupal will name for you ).
  • The previous item Id within your control bar is <div id="medialoadprev">.......</div>
  • The next item Id within your control bar is <div id="medialoadnext">......</div>

If any of these assumptions are wrong, then let me know and I will tell you how to modify the code below...

// Call this function when the player has finished loading, or immediately if it already has.
jQuery.media.onLoaded('mediafront_mypreset', function( player ) {

   // Create a pager out of the controller, and add that to the playlist.
   player.playlist.addPager( player.node.player.controller.display.mediapager() );
});

You can use the drupal_add_js method to add this JavaScript to your page if you are within PHP.

I hope this works... haven't tested it, but it should.

Let me know.

Travis.

yannickoo’s picture

Where should <div id="mediafront_mypresetmediacontrolbar">...</div> be?

travist’s picture

Same place it throws it by default. Inside the mediaregion element.

Thanks,

Travis.

yannickoo’s picture

Content of osmplayer_default_node.tpl.php:

<div id="<?php print $params['prefix']; ?>medianode">
   <div class="mediafield" type="text" field="title"></div> 
   <div id="<?php print $params['prefix']; ?>mediaregion">
<div id="mediafront_headermediacontrolbar"></div>
<div id="medialoadprev"></div>
<div id="medialoadnext"></div>
      <?php if( !$params['controllerOnly'] ) { ?>
	      <div id="<?php print $params['prefix']; ?>mediabusy"><img src="<?php print $params['playerURL']; ?>/templates/default/images/busy.gif" /></div>
	      <div id="<?php print $params['prefix']; ?>mediaplay"><img src="<?php print $params['playerURL']; ?>/templates/default/images/play.png" /></div>
	      <div id="<?php print $params['prefix']; ?>mediapreview"></div>
      <?php } ?>	      
	   <div id="<?php print $params['prefix']; ?>mediadisplay"></div>
      <?php if( $params['showController'] ) { print $controlBar; } ?>      
   </div>  
</div>

Content of my script.js

Drupal.behaviors.foo = function (content) {

    var player = jQuery.media.players.mediafront_header;

    $("a.play").click(function (event) {
        $("a.play").removeClass("pause");
        $(this).addClass("pause");
        event.preventDefault();
        player.node.loadNode($(this).attr("data-id"));
    });

    $("a.pause").click(function (event) {
        $("a.pause").removeClass("pause");
        event.preventDefault();
        player.node.player.media.player.pauseMedia();
    });

    jQuery.media.onLoaded('mediafront_header', function (player) {
       player.playlist.addPager(player.node.player.controller.display.mediapager());
    });

};

But it doesn't work.

yannickoo’s picture

StatusFileSize
new7.26 KB
IGNORE THIS
yannickoo’s picture

yannickoo’s picture

Any news here Travis?

travist’s picture

Status: Needs review » Postponed (maintainer needs more info)

Yannick,

Will you send me your template that you are working with? I will run some tests.

Thanks,

Travis.

yannickoo’s picture

You've the template (http://drupal.org/node/859846#comment-3241020)

Or did you mean my drupal theme?

thanks

yannick

travist’s picture

Is this on a live site that I can check out? That would also be helpful.

yannickoo’s picture

I will send you an e-mail okay?

yannickoo’s picture

sorry for double post
yannickoo’s picture

Here the live site: http://wtff.de/beta/player.

Let me know then.

travist’s picture

Thanks Yannick,

I will take a look when I have a moment.

Travis.

ellm’s picture

Version: 6.x-1.x-dev » 7.x-1.1

hey,
i have the sam problem,
want to move the pre next button to controlbar.
i have also try the code from yan_nik in this issue but dont work..

i want also move the fullscreen and playlist button to the controlbar..

can anybody help me..
thx