| Author |
Message |
Goberg
Joined: 18 Jan 2007 Posts: 37
|
|
Cutenews.ru and JW FLV Media Player |
|
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:
 |  | <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.
 |  | <?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:
 |  | <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.php?cat=meny&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
|
|
| Sat May 24, 2008 8:33 am |
|
 |
Guest
|
|
|
Please login to hide the ads.
|
|
|
|
 |
Partyism
Joined: 25 Sep 2007 Posts: 186
|
|
|
|
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.
|
|
| Tue May 27, 2008 11:24 am |
|
 |
scottdallas

Joined: 04 May 2006 Posts: 1808 Location: US |
|
|
|
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.
_________________ www.scottdizzle.com uses cnr
last update: 07-22-08: 8:30 pm |
|
| Wed May 28, 2008 6:53 am |
|
 |
Goberg
Joined: 18 Jan 2007 Posts: 37
|
|
|
|
whats the difference between jw mediaplayer and flowplayer?
|
|
| Fri May 30, 2008 2:07 am |
|
 |
scottdallas

Joined: 04 May 2006 Posts: 1808 Location: US |
|
|
|
 |  | 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.
_________________ www.scottdizzle.com uses cnr
last update: 07-22-08: 8:30 pm |
|
| Mon Jun 02, 2008 8:08 am |
|
 |
Partyism
Joined: 25 Sep 2007 Posts: 186
|
|
|
|
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
|
|
| Tue Jun 10, 2008 11:47 am |
|
 |
Partyism
Joined: 25 Sep 2007 Posts: 186
|
|
|
|
some feedback would be awesome
|
|
| Tue Jun 10, 2008 4:39 pm |
|
 |
Partyism
Joined: 25 Sep 2007 Posts: 186
|
|
|
|
 |  | some feedback would be awesome |
|
|
| Fri Jun 13, 2008 8:54 am |
|
 |
Goberg
Joined: 18 Jan 2007 Posts: 37
|
|
|
|
what kind of feedback do you want?
need any more help from me?
|
|
| Sat Jun 14, 2008 3:41 am |
|
 |
Partyism
Joined: 25 Sep 2007 Posts: 186
|
|
|
|
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.
 |  | <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.
|
|
| Mon Jun 16, 2008 12:06 pm |
|
 |
|