• Welcome to PHPVIBE Forums. Please log in.

[ Video Sharing CMS v4 ] how to put a player in channel pages

Started by badulake,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

badulakeTopic starter

Hi, im need put a player in categories pages, this player read the videos in chanel make playlist and autoplay all videos in channel or featured in chanel only.
its easy?

now have a embed jwplayer that read a playlist.rss acording the chanel name, but if this player reads the videos in chanel make work easy.

any sugestion?
  •  

PHPVibe A.

You can use only the videos that can be played in jwplayer, youtube and uploaded.
Where did you get stuck? So I can help you pass that phase.

badulakeTopic starter

The idea is make "live" channels
What I need is at enter in the channel page, have a player that plays the videos of this channel in autoplay.

I copied the jwplayer code in channels tpl, and reads a handmade playlist I upload to a directory:
playlist: "/uploads/'.$channel->cat_name.'.rss"


I would like the player read in database all videos uploaded of this channel directly, without having to manually modify the playlist and upload.

my knowledge of php is not enough for me to change this and i dont write correctly in english to express correctly
  •  

PHPVibe A.

I got what you need, gimme a bit of time and I can code your php handler for the playlist, right now it's weekend and I'm not at the office.

interfear

I'm very interested in this same functionality :) appreciate the guidance.
  •  

badulakeTopic starter

  •  

PHPVibe A.

So taken from here http://support.jwplayer.com/customer/portal/articles/1406722-rss-playlist-embed

I can generate an file that accepts the id of the channel.
<?php require_once("load.php");
$playlist = intval($_GET['id']);
if($playlist > 1) {
$vq = "SELECT title,thumb,source FROM ".DB_PREFIX."videos WHERE category in (select cat_id from ".DB_PREFIX."channels where cat_id='".$playlist ."' or child_of = '".$playlist ."') and source like '%youtube%' or source like 'localfile%' ORDER BY id DESC limit 0,1000";
$videos = $cachedb->get_results($vq);
if($videos) {
echo '<rss version="2.0" xmlns:jwplayer="http://rss.jwpcdn.com/">
<channel>
';
foreach ($videos as $video) {
echo '
 <item>
    <title>'._html($video->title).'</title>
    <description>'._html($video->title).'</description>
    <jwplayer:image>'.thumb_fix($video->thumb).'</jwplayer:image>
    <jwplayer:source file="'.str_replace('localfile/',site_url().get_option("mediafolder").'/',$video->source).'" />
  </item>
';

}
echo '</channel>
</rss>
';
}

} else{
//No playlist id
//Echo an error
}
?>


so if you save it as playlist.php in root, you can access it as playlist.php?id=x (where x is you actual channel's id) from the channel embedded player.

badulakeTopic starter

excelent example code, im putand work with some fixes.
last question:

-¿how show over or under the player "now playing: file blabalala"?

im try jwplayer "listbar" option but shows all playlist
  •  

PHPVibe A.

Not sure, can't find a sample at their site for this.

Similar topics (7)