Cutenews.ru and JW FLV Media Player

Share your CuteNews.RU skins and code snippets.

Cutenews.ru and JW FLV Media Player

Postby Goberg » Sat May 24, 2008 8:33 am

Hi, I though I could post this here since its working pretty good. I have been playing around with the JW FLV Player the last couple of days.

First off, I created a really easy upload script so i could upload .flv files to a folder on my server. I used this tutorial.

When I had the upload script working, I created a Quick Tag in cnr with this code, set Name and Tag to flv or something:
Code: Select all
   <center><embed src="(path to flvplayer)mediaplayer.swf" width="500" height="310" allowscriptaccess="always" allowfullscreen="true" flashvars="height=310&width=500&file=(uploaddir)/$1&image=(path to bgimage.jpg)&backcolor=0xAAAAAA&frontcolor=0x000000&lightcolor=0x000000&screencolor=0x000000&logo=(path to watermark.png)&searchbar=false&showstop=true&showdownload=true" /></center>


change the (dir to flvplayer), (uploaddir), (path to bgimage.jpg) and (path to watermark.png) to your settings (dont use the ( and )-characters ).

Now you can upload files with the fileuploader and use [flv]flvfilename.flv[/flv] to get the videoes in your news.

This is all good so far, but i also wanted a videosection on my site. I found a script that searches a folder for .flv files and makes a .xml file. This xml file can be used with JW FLV Media Player to make a playlist.

Open notepad and copy/paste the code below. Save the file as playlist.php or something. Upload playlist.php to the same dir as you upload your .flv files.
Code: Select all
<?php

/*
* This is a sample file that reads through a directory, filters the mp3/jpg/flv
* files and builds a playlist from it. After looking through this file, you'll
* probably 'get the idea' and'll be able to setup your own directory.
*
*/

// set this to a creator name
$creator = "Your name";

// search for mp3 files. set this to '.flv' or '.jpg' for the other scripts
$filter = ".flv";

// path to the directory you want to scan
// "./" = current directory
$directory = "./";

// URL to files
$url = "http://www.dummyurl.com";

/////////////////////////// no user configuration variables below this \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

// read through the directory and filter files to an array
@$d = dir($directory);
if ($d)
{
  while($entry = $d->read())
  {
    $ps = strpos(strtolower($entry), $filter);
    if (!($ps === false))
    {
      $items[$entry]['mtime'] = filemtime($entry);
    }
  }
  $d->close();
  arsort($items);
}


// the playlist is built in an xspf format
// first, we'll add an xml header and the opening tags...
header("content-type:text/xml;charset=utf-8");

echo "<?xml version='1.0' encoding='utf-8'?>\n";
echo "<playlist version='1' xmlns='http://xspf.org/ns/0/'>\n";
echo "  <title>Sample PHP Generated Playlist</title>\n";
echo "  <info>" . $url . "</info>\n";
echo "  <trackList>\n";

// ...then we loop through the array...
foreach($items as $key => $value)
{
  $title = substr($key, 0, strlen($key) - 4);
  echo "    <track>\n";
  echo "      <creator>"  . $creator          . "</creator>\n";
  echo "      <title>"    . $title            . "</title>\n";
  echo "      <location>" . $url . '/' . $key . "</location>\n";
  echo "      <image>"    . $url . '/' . $title . ".jpg</image>\n";
  echo "      <info>"     . $url              . "</info>\n";
  echo "    </track>\n";
}

// ...and last we add the closing tags
echo "  </trackList>\n";
echo "</playlist>\n";

/*
* That's it! You can feed this playlist to the SWF by setting this as it's 'file'
* parameter in your HTML page.
*/

?>


Now all you have to do is make a embed code that looks for the playlist.php file. Example:
Code: Select all
<embed
src="(path/to/mediaplayer.swf)"
width="500"
height="500"
allowscriptaccess="always"
allowfullscreen="true"
flashvars="height=500&width=500&file=(path/to/playlist.php)&image=(path/to/bgimage.jpg)&logo=(path/to/watermark.png)&displayheight=240&showstop=true&showdownload=true&autoscroll=true"
/>


thats it. hopefully someone else will try this and try to work some more on it. I would love to have a searchoption, a ratingsystem and a most viewed section

Here is what i have so far: http://playstation.sistestopp.com/side. ... videoarkiv

Ohh, and if you upload a .jpg picture with the same name as the .flv file you will have a preview image

EDIT: I use http://media-convert.com/ to convert video files to flv files.
And i have also added the upload script to the cutenews.ru admin panel, so its really easy to add files. If you want the code for that i can give it to you
Goberg
 
Posts: 79
Joined: Thu Jan 18, 2007 2:31 pm

Postby Partyism » Tue May 27, 2008 11:24 am

Sweet!, i'll test it out soon. But i'm working on a new design for my website. So ill need to finish that first. And then i'm going to start with a clean cuteru version.
Partyism
 
Posts: 399
Joined: Tue Sep 25, 2007 6:24 pm

Postby scottdallas » Wed May 28, 2008 6:53 am

I tried hardcore to use the jw flv player and I'm unfortunately going to have to stick with flowplayer. It works really well with cutefields and xfields. Preferably cutefields.
Everyday I'm tumblin http://scodal.tumblr.com
User avatar
scottdallas
 
Posts: 2209
Joined: Thu May 04, 2006 6:46 pm
Location: US

Postby Goberg » Fri May 30, 2008 2:07 am

whats the difference between jw mediaplayer and flowplayer?
Goberg
 
Posts: 79
Joined: Thu Jan 18, 2007 2:31 pm

Postby scottdallas » Mon Jun 02, 2008 8:08 am

whats the difference between jw mediaplayer and flowplayer?


I got frustrated installing jw mediaplayer easily into my site.. I needed an easy way to be able to upload .flv files and embed them into my {full-story} without much trouble. I gave up and looked around for another option.

I found flowplayer and it allows you to set up flowplayer in a 2-step process that they didn't realize also happens to coincide perfectly with cutenews.ru's cutefields and xfields. Basically, you can set it up where you put an flv file on your server, similar to uploading an .swf file.. then put the URL to the .flv file into the cutefield box.. similar to putting your {avatar} URL in the {avatar} box. Then you paste one line of code wherever you want the video to display.

The video player has lots of options including full screen.. one con is that it costs money in order to remove their fish logo and brand it with your own watermark.
Everyday I'm tumblin http://scodal.tumblr.com
User avatar
scottdallas
 
Posts: 2209
Joined: Thu May 04, 2006 6:46 pm
Location: US

Postby Partyism » Tue Jun 10, 2008 11:47 am

maybe fi-dd can make it as a plugin, this kinda work sucks because i aint that pro in php :p
and the info you gave is very short imho
Partyism
 
Posts: 399
Joined: Tue Sep 25, 2007 6:24 pm

Postby Partyism » Tue Jun 10, 2008 4:39 pm

some feedback would be awesome
Partyism
 
Posts: 399
Joined: Tue Sep 25, 2007 6:24 pm

Postby Partyism » Fri Jun 13, 2008 8:54 am

Partyism wrote:some feedback would be awesome
Partyism
 
Posts: 399
Joined: Tue Sep 25, 2007 6:24 pm

Postby Goberg » Sat Jun 14, 2008 3:41 am

what kind of feedback do you want?

need any more help from me?
Goberg
 
Posts: 79
Joined: Thu Jan 18, 2007 2:31 pm

Postby Partyism » Mon Jun 16, 2008 12:06 pm

Yeah i would like to see the upload.php file youve made from the tutorial.
I'm sure youve placed the following code in functions.inc.php at the inserttag funtion. Because when you add this tag in the admin the flv bbcode would also be placed in the comments form.
Code: Select all
<center><embed src="(path to flvplayer)mediaplayer.swf" width="500" height="310" allowscriptaccess="always" allowfullscreen="true" flashvars="height=310&width=500&file=(uploaddir)/$1&image=(path to bgimage.jpg)&backcolor=0xAAAAAA&frontcolor=0x000000&lightcolor=0x000000&screencolor=0x000000&logo=(path to watermark.png)&searchbar=false&showstop=true&showdownload=true" /></center>


The upload file would help me allot.
Partyism
 
Posts: 399
Joined: Tue Sep 25, 2007 6:24 pm

Postby Goberg » Thu Sep 04, 2008 8:18 am

Alright, I will try to explain as good as possible.
Note: You will not be able to upload avi, mov, wmv etc with this uploader. The files has to be .flv. You need ffmpeg and stuff installed on the server to encode files serverside.

Ok, so here is how I have done it.

Download the zip file attached and upload the files to the inc/mod/ folder. Now you have to give the files upload permissions to work. This is done in the index.php file. Add the code below to the index.php file at line 125 or something, just after the other stuff and above );
Code: Select all
                    'upload'      => 'user',
                    'upload2'      => 'user',
                    'done'      => 'user'


I also added a link to the upload script in the menu. This is done in the default.skin.php file. Add the code to somewhere around line 40 where you want it.
Code: Select all
<td><a class="nav" href="$PHP_SELF?mod=upload">Upload filer</a>
<td>|


That is pretty much it. Some of the language in the upload files is in Norwegian, but I'm sure you can figure out what it means, I have a link to a site where you can convert files to .flv.

Edit: and I don't use comments on my site, so I don't really care about what bbcodes that are legal .
Attachments
upload.zip
The files I have used
(1.32 KiB) Downloaded 47 times
Goberg
 
Posts: 79
Joined: Thu Jan 18, 2007 2:31 pm

Postby Partyism » Thu Sep 04, 2008 9:00 am

Zipfile has a password?
Partyism
 
Posts: 399
Joined: Tue Sep 25, 2007 6:24 pm

Postby Goberg » Mon Sep 08, 2008 7:32 am

Partyism wrote:Zipfile has a password?


no
Goberg
 
Posts: 79
Joined: Thu Jan 18, 2007 2:31 pm

Postby Partyism » Thu Oct 02, 2008 12:17 pm

still working on it but its hard.

What is your code for this one?
Code: Select all
<center><embed src="(path to flvplayer)mediaplayer.swf" width="500" height="310" allowscriptaccess="always" allowfullscreen="true" flashvars="height=310&width=500&file=(uploaddir)/$1&image=(path to bgimage.jpg)&backcolor=0xAAAAAA&frontcolor=0x000000&lightcolor=0x000000&screencolor=0x000000&logo=(path to watermark.png)&searchbar=false&showstop=true&showdownload=true" /></center>
Partyism
 
Posts: 399
Joined: Tue Sep 25, 2007 6:24 pm

Re: Cutenews.ru and JW FLV Media Player

Postby Hawk » Wed Dec 14, 2011 7:09 pm

Can you explain, is there no audio when running a movie in JW player or did you download a movie to your local computer?
User avatar
Hawk
 
Posts: 279
Joined: Tue Aug 29, 2006 9:00 pm


Return to Skins and snippets



Who is online

Users browsing this forum: No registered users and 0 guests

cron