Home > Uncategorized > Youtube videos playing on jwplayer

Youtube videos playing on jwplayer

February 13th, 2010 Leave a comment Go to comments

Before you start.. the version of flvplayer which comes with phpmotion is broken in respects of playing youtube videos correctly . You will have to upgrade to the latest version which actually works but this is a pay for version unless you want the flvplayer logo on the bottom left at startup. Upgraed to this 1st before you start this.

Cost $Free

If you are not using the default theme then change the file in your theme.
ie themes/YOURTHEME/.. etc

There are 2 Parts to this.

1 – Change to use FLVPlayer on youtube videos.

Make sure you have yt.swf file in the root directory.

edit themes/default/templates/inner_play.htm

Between <!–Start Player–> and <!–End Player–>
change to.
<!–Start Player–>
<div class=”container-player”>
<iframe src=”[var.base_url]/make_player.php?vid=[var.vid]&player_token=[var.player_token]” style=”width:560px; height:420px; border:none;” marginheight=”0″ scrolling=”no” name=”flvplayer”>
<!–End Player–>

edit themes/default/templates/make_player.htm

so.addVariable(“file”, “uploads/[var.video_play]“);
so.addVariable(“file”, “[var.video_play]“);

edit make_player.php
$sql = “SELECT video_id FROM videos WHERE indexer = ‘$vid’”;
$sql = “SELECT video_id,video_type,embed_id FROM videos WHERE indexer = ‘$vid’”;

$video_id = $row['video_id'];
$video_type = $row['video_type'];
$embed_id = $row['embed_id'];

$video_play = $video_id.’.flv’;
if ($video_type == “uploaded”) {
$video_play = ‘uploads/’.$video_id.’.flv’;
} else {
$video_play = ‘http://www.youtube.com/watch/v/‘.$embed_id;

2 – Change Embed Option for Youtube Videos (this is broken in default phpmotion)

edit themes/default/templates/inner_play.htm

change to

edit play.php
$video_play = $result['video_id'] . ‘.flv’;
if ($video_type == “uploaded”) {
$video_play2 = $base_url.’/uploads/’.$result['video_id'] . ‘.flv’;
} else {
$video_play2 = ‘http://www.youtube.com/watch/v/‘.$embed_id;

Categories: Uncategorized Tags: , ,
  1. April 20th, 2010 at 05:47 | #1

    Hi. I have recently installed the JW Player 5.1 for my website, ceetube.com and tried to install the psuedo streaming it worked for me. I was trying to get youtube videos to play on the JW flv player but they didn’t work for me. It gave me a message like the video wasn’t found or the video id is invalid. I followed exactly every instruction given on this website and as well as on the phpmotion forum but that did not work for me. Is there any way that I can get help please. I would be willing to pay to anybody who helps me with this. I desperately need the embedded youtube videos to play with the JW player.

    Thanks in advance.

  2. May 1st, 2010 at 02:59 | #2

    Hope you someone can help me with this.
    I followed every step , youtube video loading in JWplayer but when i click play it keeps loading.
    Uploaded videos playing fine.
    youtube video:http://sotnic.com/videos/60/sweetest-girl-%28dollar-bill%29

  3. admin
    May 15th, 2010 at 01:40 | #3

    email me directly with your problem.


  4. May 25th, 2010 at 18:54 | #4

    could you please write an addon for embedding from other websites so the admin have only to paste the embed code and this code will be showen in the place the video is supposed to

    so you can make a game website , or , embed stuff from zshare and so on i will pay 30 Dollars for the pluggin :) you can make good money selling it although you can make me a sale since i gave you the idea

  1. No trackbacks yet.