Facebook Twitter RSS
About
Forum
Demo
Products
Home
 

  • Home
  • Forum
  • Help
    • TinyPortal
  • Search
  • Login
  • Register

  • PHPmotionWiz Forum »
  • Mods »
  • JW Player Integration »
  • How to get JW Player to play Youtube Videos

  • Print
Pages: [1]   Go Down

Author Topic: How to get JW Player to play Youtube Videos  (Read 831 times)

0 Members and 1 Guest are viewing this topic.

Offline Cherice

  • Newbie
  • *
  • Posts: 7
  • Liked: 0
    • View Profile
How to get JW Player to play Youtube Videos
« on: April 09, 2011, 01:39:36 AM »
How can i get youtube videos to play in the JW player in the index page? I've combed the forums and I'm sure the answer's in here somewhere. Just can't seem to find it. Please help. I'm losing hair over here.  :-\

http://blackbeautybuzz.com
Logged

Offline Shawn

  • Administrator
  • Hero Member
  • *****
  • Posts: 871
  • Liked: 18
    • View Profile
Re: How to get JW Player to play Youtube Videos
« Reply #1 on: April 09, 2011, 10:19:53 AM »
This should help
http://phpmotion.com/forum/index.php?topic=15484.0
Logged
Please read why I ask people not to PM me for support.

Offline Cherice

  • Newbie
  • *
  • Posts: 7
  • Liked: 0
    • View Profile
Re: How to get JW Player to play Youtube Videos
« Reply #2 on: April 09, 2011, 10:35:07 AM »
Thanks. I read the suggested post and tried editing the playlist.php but unfortunately, the code does not match. See my playlist.php below.

 
Code: [Select]
<?php

/**
 * -------------------------USING THE PLAYLIST----------------------
 * You can set in the url query
 * -limit: ( number of videos returned) <optional>
 * -search: ('a seach query useful for related videos') <otional>
 * -type: ('featured'; 'promoted')
 *
 * --By default the playlist will be for latest videos.
 * --Specifying a search query will overide any 'type' setting
 * --Output is an xml file
 * -----------------------------------------------------------------
 */

include_once ('classes/config.php');


//____get video limit________
function GetVideoLimit() {
    
$limit = (is_numeric($_GET['limit']))?$_GET['limit']:12;
    return 
$limit;
}


//____get the type $sql________
function GetVideoType() {
    switch(
$_GET['type']) {
        case 
'featured':
            
$add_sql = " AND featured = 'yes'";
            break;

        case 
'promoted':
            
$add_sql = " AND promoted = 'yes'";
            break;
    }
    return 
$add_sql;
}


//____get search query_________
function GetVideoSearch() {

    if(
$_GET['search'] != '') {
        
$keywords = str_replace('+',' ',$_GET['search']);
        
$keywords = str_replace('%20',' ',$keywords);
        
$keywords = str_replace('%26','&',$keywords);

        
$safety = array('UNION','=',"'",'?');
        
$keywords = str_replace($safety,'',$keywords);
        
$search = " AND (title LIKE '%$keywords%' OR tags LIKE '%$keywords%' OR description LIKE '%$keywords%')";
        return 
$search;
    } else {

        return;
    }


}

//____some cleanup___________
function CleanTitle($txt = '') {
    
$txt = trim($txt);
    
$txt = str_replace('"',"",$txt);
    
$txt = str_replace("'","",$txt);
    
$txt = str_replace('?','',$txt);
    return 
$txt;
}


//____run sql query__________
$limit = GetVideoLimit();
$search = GetVideoSearch();
$type = ($search == '')?GetVideoType():''; //set type only if search is blank

$sql = "SELECT indexer, video_id, title, description
        FROM videos
WHERE approved = 'yes'
AND public_private = 'public'
AND video_type = 'uploaded'
$type $search
ORDER BY RAND()
LIMIT $limit"
;
$query = @mysql_query($sql);


//____start xml file headers____________
header("Content-Type: text/xml; charset=UTF-8");
header("Expires: 0");
print 
"<?xml version=\"1.0\"?>
\n";
print "<playlist>\n";



//_____loop through all results____________
while($result = @mysql_fetch_array($query)) {

    $title = CleanTitle($result['title']);
    $title_seo = CleanTitle($result['title_seo']);
    $vid = $result['indexer'];
    $file_name = $result['video_id'];
    $external_url = $config["site_base_url"].'/videos/'.$vid.'/'.$title_seo;
    $source_url = $config["site_base_url"].'/uploads/'.$file_name.'.flv';
    $thumb_path = $base_path.'/uploads/player_thumbs/'.$file_name.'.jpg';
    $source_path = $base_path.'/uploads/'.$file_name.'.flv';

    //cant find big thumb file
    if(file_exists($thumb_path)) {
        $thumb_url = $config["site_base_url"].'/uploads/player_thumbs/'.$file_name.'.jpg';
    } else {
        $thumb_url = $config["site_base_url"].'/uploads/thumbs/'.$file_name.'.jpg';
        $thumb_path = $base_path.'/uploads/thumbs/'.$file_name.'.jpg';
    }

    //only list if the video file and imagae exist
    if(file_exists($source_path) && file_exists($thumb_path)) {
        print "<video>\n";
        print "<title>$title</title>\n";
        print "<source>$source_url</source>\n";
        print "<thumb>$thumb_url</thumb>\n";
        print "<external_url>$external_url</external_url>\n";
        print "<duration>0.00</duration>\n";
        print "</video>\n";
    }
}
print "</playlist>";


?>

Logged

Offline Shawn

  • Administrator
  • Hero Member
  • *****
  • Posts: 871
  • Liked: 18
    • View Profile
Re: How to get JW Player to play Youtube Videos
« Reply #3 on: April 09, 2011, 11:13:05 AM »
Quote from: Cherice on April 09, 2011, 10:35:07 AM
Thanks. I read the suggested post and tried editing the playlist.php but unfortunately, the code does not match. See my playlist.php below.

I forgot that it changed when they released the new player.

You want to edit playlist-v3.php.  Other than that, the instructions should be the same.
Logged
Please read why I ask people not to PM me for support.

Offline safiya collymore

  • Newbie
  • *
  • Posts: 3
  • Liked: 0
    • View Profile
Re: How to get JW Player to play Youtube Videos
« Reply #4 on: December 04, 2011, 02:26:10 AM »
Hi I would also like to use JW player for youtube videos. I would like to know if the JW player was useable as the inner player  instead of the phpmotion player.   And I am using the Mass Video Embedder, would my youtube videos show in the the JW player?

Thanks a Trillion
Logged

Offline justwushu

  • Global Moderator
  • Full Member
  • *****
  • Posts: 194
  • Liked: 9
    • View Profile
    • Just Wushu video Sharing
Re: How to get JW Player to play Youtube Videos
« Reply #5 on: December 04, 2011, 02:34:58 PM »
Hi safiya,

yes you can use JWPlayer in PHPmotion. However, you have to mod PHPmotion to use it.  You can purchase PHPmotioniz's JWPlayer mod:

http://phpmotionwiz.com/index.php?page=shop.browse&category_id=3&option=com_virtuemart&Itemid=&vmcchk=1&Itemid=1

or do it yourself.

Yes, you can play Youtube videos in JWPlayer. Read these posts:

http://phpmotion.com/forum/index.php?topic=15484.0

http://phpmotion.com/forum/index.php?topic=16056.0

These mods were made when PHPmotion was v3 and using JWPlayer as its default player.  However, you need a v3 playlist, rather than a v3.5 playlist.

Sorry, I can't comment any further, as I last tested it about two years ago, and haven't used it since.  JWPlayer and Youtube have upgraded and changed a few things. I am not sure if the mods are still functioning? I have seen a number of sites with broken Youtube videos, apparently using the JWPlayer mod.

Probably caused by an old version JWPlayer, which hasn't been updated. Youtube has changed a few things, which JWplayer had to adapt too!

Best to follow the threads in the above mentioned posts.
« Last Edit: December 04, 2011, 05:46:25 PM by justwushu »
Logged

  • Print
Pages: [1]   Go Up
  • PHPmotionWiz Forum »
  • Mods »
  • JW Player Integration »
  • How to get JW Player to play Youtube Videos
 

Recent Posts

  • Center Spotlight Video by quantum
    [Today at 08:02:24 PM]
  • phpmotion subscription ma... by justwushu
    [Today at 05:55:18 PM]
  • Simpson Video in Spotligh... by justwushu
    [Today at 04:21:52 PM]
  • Video Size and Type by Neil Stalker
    [May 17, 2012, 07:14:22 PM]
  • member video not working by vidzmax
    [May 17, 2012, 10:00:24 AM]
  • HELP! I need OpenX Remove... by Shawn
    [May 17, 2012, 09:07:44 AM]
  • Blank Page - Help by Siulwon
    [May 17, 2012, 03:41:33 AM]
  • Eclipse Light (Coming Soo... by Shawn
    [May 16, 2012, 11:43:52 AM]
  • how to change logo in bro... by Jessica Woods
    [May 15, 2012, 01:23:34 PM]
  • Embed video not showing i... by Shawn
    [May 15, 2012, 10:06:15 AM]

  • SMF 2.0.2 | SMF © 2011, Simple Machines
    TinyPortal © 2005-2012
  • XHTML
  • RSS
  • WAP2