Display more than one Dash Players on the same node
design.er - September 30, 2009 - 18:51
| Project: | Dash Media Player |
| Version: | 6.x-1.7 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Hello,
I use successfully the Dash Player and it's awesome.
Now I have to emfield video fields and have to show both videos - each in a separate player - on the same node.
I use the PHP embed code from the screencasts:
The first field:
<?php
if (!empty($node->field_video_embed[0]['view'])) {
$params['node'] = $node->nid;
$params['volume'] = 100;
$params['width'] = 540;
$params['height'] = 405;
print dashplayer_get_player( $params );
}
?>The second field:
<?php
if (!empty($node->field_video_embed_two[0]['view'])) {
$params['node'] = $node->nid;
$params['volume'] = 100;
$params['width'] = 540;
$params['height'] = 405;
print dashplayer_get_player( $params );
}
?>The problem is that only the second player reacts - even if I click "play" on the first player.
Can you tell me how I can use two players on one node?
Thank you very much! :)
Stefan

#1
The best way to do this is to use two separate blocks with the code for your players on a single page node. Use this code in each block, change the name of the 'playlist' accordingly:
<?php$params['playlist'] = 'videos';
print dashplayer_get_player($params);
?>
An alternative to this is to create two playlists within the same player, see the "filtering a playlist" tutorial here: http://www.tmtdigital.com/node/37
I hope this is helpful.
#2
Thank you for the tip. But I don't agree that this is the best way. It's really complex - I have to create nodes for each player, create a view playlist for each of them and embed them into the target node... or embed the node into the node body. It's both very user unfriendly and takes a lot of time.
Is there no more user friendly and efficient way to do this? I mean this player can almost everything so I can't imagine that it should fail on this trivial request.
#3
Actually this is a bug with the YouTube Chromeless player and not the Dash Media Player.
Apparently, there is a bug that does not allow for more than one YouTube player to be placed on the screen at a time. However, there seems to be a fix for this. I did read this http://www.perkstoveland.com/archives/40 which talks about a way for this player to allow for multiple YouTube players on the page. However, this basically means that the YouTube component that I am currently using for the DMP is going to have to be refactored.
Definitely doable, but given the current work load, I don't see this happening unless someone else is up to the challenge. I am willing to share all source code if anyone is up for it ( as long as they re-contribute ).
Thanks,
Travis.
#4
Hi Travis,
Thanks for your time to help on this. You are right that it does not work with two YouTube videos. I also tested it with normally uploaded movies - I uploaded a .mov and a .flv movie on the same node and it didn't work. The movies are getting loaded but can't be played.
Am I missing something?