Project:Dash Media Player
Version:6.x-1.7
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:scottalan
Status:active

Issue Summary

I watched the videos, but didn't see this subject brought up in them.

Is it possible to have a single dashplayer handle both, audio and video playlists? I was trying something along the lines of:

<?php
$params
['linkarg1'] = "videos";
$params['linkindex1'] = 0;
$params['linktext1'] = "Videos";
$params['playlist1'] = 'videos';

$params['linkarg2'] = "Mp3s";
$params['linkindex2'] = 0;
$params['linktext2'] = "Mp3s";
$params['playlist2'] = 'audio';

print
dashplayer_get_player( $params );
?>

but, it didn't work.. What I'm trying to accomplish is having a single player page come up, and based on which tab you choose, it selects the audio or video playlists. If someone has figured out a way to get this to work, could you post the solution? Thanks!

Greywolf

Comments

#1

Assigned to:Anonymous» scottalan

Yes, it's definitely possible. Below is the code used to make this happen-

<?php
$params
['config'] = 'yourConfigFile';
$params['skin'] = 'theNameOfYourSkin';
$params['playlist'] = 'theViewName';
$params['width'] = '640';
$params['height'] = '360';
$params['autostart'] = 'false';

$params['linkalltext'] = 'All'; //"All" is used by default but you can change this...
$params['linkallindex'] = '0';

$params['linktext1'] = "Video";
$params['linkarg1'] = "video";
$params['linkindex1'] = 0;

$params['linktext2'] = "Audio";
$params['linkarg2'] = "audio";
$params['linkindex2'] = 0;

print
dashplayer_get_player( $params );
?>

-Scott

#2

looking at this.. I'm still a little confused.. in the $params['playlist'] = 'theViewName', how does it differentiate between audios or videos, since they are uploaded as two different content types? Would I just delete one of the content types, and change the remaining one to something like, multimedia, and just change the allowed file extensions to include both graphics and audio in there? I think this idea may have some merit, but not 100% sure. What would be a plus would be a way to have it switch skins based on whether the files are audio or video (ie: audiopro or default). I'm probably being way too wishful on trying to accomplish this, but it was just a thought.

- Jim

#3

Sorry for the confusion. Here is the way I have this set up:

Content Types:
Audio
Video
View name:
media
Arguments:
Node: Type
Filters:
Node: Published Yes
Node: Type in Audio, Video

The $params['linkarg1'] = 'audio'; tells the player to only show the content type of 'audio' in that particular tab. The same is true of any media type you would like to see displayed in that 'tab'.

The view uses filters to determine what content types are allowed in that view. Arguments are used to determine which content type the player will show.

If your unsure how views args works, or how filtering works I would recommend checking this out: http://views-help.doc.logrus.com/

Hope this helps

#4

Another option would be to have "2" completely different playlists connected to the same 'player'.

Example:

<div style="float:left;">
<?php
$params
['width'] = 450;
$params['height'] = 405;
$params['disableplaylist'] = 'true';
$params['id'] = 'dashplayer';
$params['connect'] = 'vplaylist_and_hplaylist'//These are vplaylist.swf and hplaylist.sfw - located in your /skins folder
print dashplayer_get_player($params);
?>

<br/>

<?php
$params
= array();
$params['width'] = 450;
$params['height'] = 150;
$params['playlistonly'] = 'true';
$params['playlistskin'] = 'hplaylist';
$params['vertical'] = 'false';
$params['playlist'] = 'media';
$params['arg1'] = 'video'//Telling this playlist to only list 'video' (content type)
$params['id'] = 'hplaylist';
$params['connect'] = 'dashplayer';
print
dashplayer_get_player($params);
?>

</div>

<?php
$params
= array();
$params['width'] = 200;
$params['height'] = 530;
$params['playlistonly'] = 'true';
$params['playlist'] = 'media';
$params['arg1'] = 'audio'//Telling this playlist to only list 'audio' (content type)
$params['id'] = 'vplaylist';
$params['connect'] = 'dashplayer';
print
dashplayer_get_player($params);
?>

I wasn't sure if this is what you were looking for....

-Scott

#5

Scott,
this is close to what I wanted! Thank you so much for your help! I used the 2nd version you posted and installed perfectly and runs fairly well. Thanks again!

-Jim

#6

Your Welcome! Glad it helped.

-Scott

#7

Scott,
Okay, I'm using my setup for my playlists based off message #4 here, I seen in the other threads your able to get dash working with services 2.0, and needing to put the $params['api'] = 3; line in the php coding.. Just want to see where I'm going wrong with this.. I've downloaded the beta 3 of the dash player, from the IE8 issue topic..

My dashconfig.xml file is as follows:

<params>
<license><!-- Enter your License here --></license>
<gateway>http://moonlightway.homeip.net/?q=services/amfphp</gateway>
<apiKey>79999eef8cffa2951a78a9eb6c431fed</apiKey>
<baseURL>http://moonlightway.homeip.net</baseURL>
<flashvars>
<drupalversion>6</drupalversion>
<api>3</api>    // use 2 for services 1.5
</flashvars>
</params>

and I'm still using the older jquery_update, not the current developer version

and my node post with the php code is as follows:

<div style="float:left;">
<?php
$params
['width'] = 450;
$params['height'] = 405;
$params['disableplaylist'] = 'true';
$params['id'] = 'dashplayer';
$params['connect'] = 'vplaylist_and_hplaylist'//These are vplaylist.swf and hplaylist.sfw - located in your /skins folder
print dashplayer_get_player($params);
?>

<br/>

<?php
$params
= array();
$params['width'] = 450;
$params['height'] = 150;
$params['playlistonly'] = 'true';
$params['playlistskin'] = 'hplaylist';
$params['vertical'] = 'false';
$params['playlist'] = 'videos';
$params['arg1'] = 'video'//Telling this playlist to only list 'video' (content type)
$params['id'] = 'hplaylist';
$params['connect'] = 'dashplayer';
print
dashplayer_get_player($params);
?>

</div>

<?php
$params
= array();
$params['width'] = 200;
$params['height'] = 530;
$params['playlistonly'] = 'true';
$params['playlist'] = 'audio';
$params['arg1'] = 'audio'//Telling this playlist to only list 'audio' (content type)
$params['id'] = 'vplaylist';
$params['connect'] = 'dashplayer';
print
dashplayer_get_player($params);
?>

Now, do I enable the key authentication module that came with services 2.0 or not?

As it is right now, if I stay with services 1.5, and change the config file to api 2, player works perfectly..
switch to services 2, and switch the api to 3.. get the constant loading state.. any ideas what I'm overlooking?

Thanks
Jim

#8

I was using "vplaylist" as an example for the "vertical playlist", but you need to change it to just "playlist". I believe this is the problem. Unless you have renamed the file to "vplaylist".

  1. Base on the code above you have two 'views' set up:
  2. One called - videos
    One called - audio

  3. I pull all my content from one 'view' called "media"
  4. I then use arguments in that 'view' to tell each playlist what I want displayed.
  5. Content Type - video
    Content Type - audio

  6. If you have two different 'views' set up then you wouldn't need the [arg] parameter. You can just use the different 'playlist views' you have set up.

Let me know if this helps.

-scott

#9

A bit off topic (but still related enough for this thread i think): Is it possible to simply define the skin.swf to use in the $params?

I need to setup 3 players, using 3 different skins, on the same site, and control when to display the player with which skin.
I tried setting the $params['connect'] but it doesn't seem to work - is that what it does...?

Is there another way to specify a specific skin.swf when printing dashplayer_get_player($params) ?

Thanks... ;)

#10

Scott,
I did notice something, that you may want to investigate further into..

When using services 6.x-2, the player will come up on single nodes, but will not pull up playlists..

I also noticed dashplayer seems to not get along with views 3 branch...

So, if a person wants to attach dashplayer to a single node, with services 6.x-2, it should work. I tried with the above suggestions, and still can't get it work correctly with the updated services. It plays perfectly with services 6.x-0.1.5, views 6.x-2.10 flawlessly(albiet slowly because its parsing both audio and video at the same time) to where I re-split it back to 2 separate players again.

#11

Hey Scott, long time since I last bugged you on this. I've re-built my site, and am re-doing the media player for it and have hit a small snag with this suggested method for having one player with audio and video. Regardless of choosing Audio or Video on their tabs, it's showing all audio and video files. When I set my view up, media, I did it as a node type, and have it looking for node types Audio and Video in the same instance. I think that is correct, and under filters it should not show:
Type = Audio
Type = published
Type = Video
Type = Published

but should look like
Type = Audio, Video
Type = Published

is there a bug in the above code of yours? (Drupal 6 still)

Jim