Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

Playlist and D-Related

12 replies [Last post]

I have the player loading the playlists.
Now I'm asked to have the player play through all of the items on the playlist without having to hit next or hit on the item. I haven't looked into that just yet.

Main problem I'm having is setting up the d-related variables for each playlist item. I'm not sure how to edit the playlist.xml file in order for the plugin to understand where to get each items d-related.xml as in:

<rss version="2.0" xmlns:jwplayer="http://developer.longtailvideo.com/trac/wiki/FlashFormats"
xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title><?=$playlist->getName()?></title>
<?php foreach($items as $item):?>
<item>
<title><?=$item->getJWTitle()?></title>
<link><?=$item->getJWLink()?></link>
<description><?=$item->getJWDescription()?></description>
<enclosure url="<?=$item->getJWURL()?>" />
<jwplayer:author><?=$item->getJWAuthor()?></jwplayer:author>
<jwplayer:type><?=$item->getJWType()?></jwplayer:type>
<jwplayer:duration><?=$item->getJWDuration()?></jwplayer:duration>
<jwplayer:streamer><?=$item->getJWStreamer()?></jwplayer:streamer>
<jwplayer:autostart>true</jwplayer:autostart>
<?php if(get_class($item) == 'Video'): ?>
<jwplayer:drelated>
<jwplayer:dxmlpath>/video/related?video_id=<?=$item->getId()?></jwplayer:dxmlpath>
<!-- ^ this area here i just made these tags up because I'm not quite sure what they should actually be. -->
</jwplayer:drelated>
<?php endif; ?>
<media:thumbnail url="<?=$item->getJWThumbnail()?>"/>
</item>
<?php endforeach; ?>
</channel>
</rss>

any help would be greatly appreciated.

and while i'm at it.

is there any possibility to dynamically edit the playlist through javascript API? if that's not possible i have no choice but to hide the default playlist and make my own HTML playlist with reorder remove and add controls

1.) Set the repeat flashvar to list:
http://developer.longtailvideo.com/trac/wiki/FlashVars#Behaviour

2.) You can't modify the playlist via the JavaScript API. Sorry!

 
1) It's a very poor programming paractice to mix PHP with XML or HTML.

2) Only the File Properties flashvars can be put into a playlist.

See: http://developer.longtailvideo.com/trac/wiki/FlashVars#Fileproperties

Therefore, you cannot have autostart in a playlist:

<jwplayer:autostart>true</jwplayer:autostart>

3) Most of the plugins don't read flashvars from a playlist (captions & audiodescription being exceptions), so you can't have the drelated lists loaded from a playlist, so this code has to go into the trash can:

  if(get_class($item) == 'Video')
  {
    print <<<END
      <jwplayer:drelated>
        <jwplayer:dxmlpath>/video/related?video_id={$item->getId()}</jwplayer:dxmlpath>
      </jwplayer:drelated>

END;

  }

4) The PHP heredoc is an easy to include PHP within text (the XML elements).

5) That leaves us with something like this:

WARNING: I don't have your playlist class, so the code is untested!

<?php

print 

<<<END
<rss version="2.0" xmlns:jwplayer="http://developer.longtailvideo.com/trac/wiki/FlashFormats" xmlns:media="http://search.yahoo.com/mrss/">
  <channel>
    <title>
{$playlist->getName()}</title>

END;

foreach(

$items as $item)
{
  print <<<END
    <item>
      <title>
{$item->getJWTitle()}</title>
      <link>
{$item->getJWLink()}</link>
      <description>
{$item->getJWDescription()}</description>
      <enclosure url="
{$item->getJWURL()}" />
      <jwplayer:author>
{$item->getJWAuthor()}</jwplayer:author>
      <jwplayer:type>
{$item->getJWType()}</jwplayer:type>
      <jwplayer:duration>
{$item->getJWDuration()}</jwplayer:duration>
      <jwplayer:streamer>
{$item->getJWStreamer()}</jwplayer:streamer>
      <media:thumbnail url="
{$item->getJWThumbnail()}"/>
    </item>

END;

}

print <<<END
  </channel>
</rss>

END;

?>

Actually, you can modify the playlist through the JavaScript API.

Simply retrieve the playlist, add, remove, sort, shuffle, etc. then reload the playlist.

Look through the code in this page and you will see the functions for manipulating the playlist.

    http://willswonders.myip.org:8074/AddItem_v4-1.html

I also have the code for sorting, reversing, shuffling and generally making a real mess out of the playlist if you need it.

thanx to all replies.

I'm using symfony framework, where all my sound and video Classes (symfony generated data retrieval classes) implement JWPlayerItem interface. and so on so on. except the d-related part the playlist generation works fine. I haven't tested it with all possible data, but so far so good.

OMG thanx for clearing the whole playlist manipulation.
I gotta look into more. and if I'm completely stuck I'll come back. thank you very much.

PS whose page is http://willswonders.myip.org:8074/AddItem_v4-1.html? yours? just more info on this work please. Someone needs some credit. :D

I have 3,000+ more pages, so if you need more examples, just ask.

http://www.voodoo.mn/music

down in the right corner.. there's a playlist container..
i haven't integrated any client side sorting as a matter of fact any sorting at all.. just in case anyone is interested where all of this is applied or going to be or was considered to be applied.

PS site is mongolian so i doubt anyone would understand the content

I have one suggestion for you: make the whole playlist track rectangle clickable.

You can see how I setup an HTML playlist on this Test Page: http://willswonders.myip.org:8074/Simple_HTMLPlaylist.html

yes, sorry I wasn't clear enough.
the playlist container contains the playlists and their items. but the JWPlayer itself opens up when you click 'play' which is right next to the playlist.

the JWplayer might require a log in, depending whether the admin has updated the www to latest SVN revision.

but yes that was the intented design to b used with the player.

thanx lost

(dramatically) noooooo......

the link died. should have downloaded. help.

for some reason a thing i'm doing is working when firebug is on Windows in FF, but works fine regardless firebug on Linux FF haven't tried IE yet.

thought it might have someithng to do with console.log?

if(get_class($item) == 'Video')
{
print <<<END
<jwplayer:drelated>
<jwplayer:dxmlpath>/video/related?video_id={$item->getId()}</jwplayer:dxmlpath>
</jwplayer:drelated>

END;

}

<?php

print <<<END
<rss version="2.0" xmlns:jwplayer="http://developer.longtailvideo.com/trac/wiki/FlashFormats" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title>{$playlist->getName()}</title>

END;

foreach($items as $item)
{
print <<<END
<item>
<title>{$item->getJWTitle()}</title>
<link>{$item->getJWLink()}</link>
<description>{$item->getJWDescription()}</description>
<enclosure url="{$item->getJWURL()}" />
<jwplayer:author>{$item->getJWAuthor()}</jwplayer:author>
<jwplayer:type>{$item->getJWType()}</jwplayer:type>
<jwplayer:duration>{$item->getJWDuration()}</jwplayer:duration>
<jwplayer:streamer>{$item->getJWStreamer()}</jwplayer:streamer>
<media:thumbnail url="{$item->getJWThumbnail()}"/>
</item>

END;

}

print <<<END
</channel>
</rss>

END;

?>

<jwplayer:autostart>true</jwplayer:autostart> if(get_class($item) == 'Video')
{
print <<<END
<jwplayer:drelated>
<jwplayer:dxmlpath>/video/related?video_id={$item->getId()}</jwplayer:dxmlpath>
</jwplayer:drelated>

END;

} <?php

print <<<END
<rss version="2.0" xmlns:jwplayer="http://developer.longtailvideo.com/trac/wiki/FlashFormats" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title>{$playlist->getName()}</title>

END;

foreach($items as $item)
{
print <<<END
<item>
<title>{$item->getJWTitle()}</title>
<link>{$item->getJWLink()}</link>
<description>{$item->getJWDescription()}</description>
<enclosure url="{$item->getJWURL()}" />
<jwplayer:author>{$item->getJWAuthor()}</jwplayer:author>
<jwplayer:type>{$item->getJWType()}</jwplayer:type>
<jwplayer:duration>{$item->getJWDuration()}</jwplayer:duration>
<jwplayer:streamer>{$item->getJWStreamer()}</jwplayer:streamer>
<media:thumbnail url="{$item->getJWThumbnail()}"/>
</item>

END;

}

print <<<END
</channel>
</rss>

END;

?>