• Welcome to Simple Machines Community Forum. Please login or sign up.
December 06, 2021, 10:07:13 PM

News:

Follow SMF on Twitter.


JW Player

Started by nikan, May 14, 2010, 02:16:29 AM

Previous topic - Next topic

nikan

May 14, 2010, 02:16:29 AM Last Edit: June 03, 2013, 02:21:51 PM by nikan
Link to Mod

Introduction
JW Player mod integrates JW Player into SMF and adds a bbcode button to insert video and audio files.
The files must reside on the same server, except youtube videos.

JW Player License:
For non-commercial use the JW Player 5 for Flash is licensed as open source software under a non-commercial variation of the Create Commons License.

Features
* Adds a BBCode button to insert flv,swf,mp4,mp3,aac files
* Uses JW Player to play the files

Languages
english
english-utf8
greek
greek-utf8

History
1.1 - Added parameter for preview image
1.0 - Initial release

divecall

Thank you for this mod. Its a good and nice one.

But i have a little problem: it is necessary, that the movie is hosted on my server. so in my case, only the admin (me) can show the movie. it´s ok, but i know the BBC-code now. How can i delete the button in the posting area ? it is not necessary for the other, because they never can upload movies...
how can i delete the marked button in the picture ?

vicram10

nice mod...

@divecall

try

In Sources/Subs-Editor.php

Find


array(
'image' => 'jwp',
'code' => 'jwp',
'before' => '[jwp=425,344]',
'after' => '[/jwp]',
'description' => $txt['jwplayer']
),


Replace with


/* array(
'image' => 'jwp',
'code' => 'jwp',
'before' => '[jwp=425,344]',
'after' => '[/jwp]',
'description' => $txt['jwplayer']
),
*/


and test it

divecall

Thank you, problem solved...

great mod (and great support !).


Mick.

I like this.  Very cool man ;)

gbsothere

May 22, 2010, 05:41:57 PM #6 Last Edit: May 22, 2010, 05:59:47 PM by gbsothere
Just a quick comment...  The instructions (1.1.11, default) for manual installation are:

Move the included file "player.swf" to "./Themes/default".
Move the included file "swfobject.js" to "./Themes/default".
Move the included file "yt.js" to "./Themes/default".
Move the included file "jwp.gif" to "./Themes/default/images/bbc"

There is no "yt.js" in the zip, but there is a "yt.swf".  I'm sure that's what you meant, but I thought you might not mind if I pointed it out, in case you wanted to make a slight change in the parsing instructions?

:) 



ETA:  Great mod; works beautifully.  Thank you.
My apologies, but I am taking a break from accepting PM requests for support.  If I am not currently assisting you, please do not ask as long as this notice is posted.  Thank you.

I Don't Want To Grow Old Alone


It has been proven that Steely Dan reduces the occurrence of road rage, according to an independent study.



A reminder about admin / ftp passwords etc.

nikan

Quote from: gbsothere on May 22, 2010, 05:41:57 PM
Just a quick comment...  The instructions (1.1.11, default) for manual installation are:

Move the included file "player.swf" to "./Themes/default".
Move the included file "swfobject.js" to "./Themes/default".
Move the included file "yt.js" to "./Themes/default".
Move the included file "jwp.gif" to "./Themes/default/images/bbc"

There is no "yt.js" in the zip, but there is a "yt.swf".  I'm sure that's what you meant, but I thought you might not mind if I pointed it out, in case you wanted to make a slight change in the parsing instructions?

:) 



ETA:  Great mod; works beautifully.  Thank you.

Fixed and updated the package. Thanks gbsothere

BobDoyle

I didn't see this addressed, but I'm wondering about any plans to add the ability to add other JWPlayer parameters like image, autostart, skin, etc.)

Is it safe to assume that I can go to the source code added and hardcode those values if they are consistent throughout the forum (and point to my licensed JWPlayer if I want?)

Thanks,

Bob

jaisi

i have just install this mod but i don't know how to  upload mp3 Files ?? please guide me

nikan

Quote from: BobDoyle on May 25, 2010, 09:40:42 AM
I didn't see this addressed, but I'm wondering about any plans to add the ability to add other JWPlayer parameters like image, autostart, skin, etc.)

Is it safe to assume that I can go to the source code added and hardcode those values if they are consistent throughout the forum (and point to my licensed JWPlayer if I want?)

Thanks,

Bob

I made a modified version for my demo site with image parameter but you can add any parameter you want at your site and if you are kind enough you can post here any change you make as long it is for the non-commercial version of jw5.
Yes you can do changes in the code to point to your licensed JWPlayer.

Quote from: jaisi on May 25, 2010, 10:55:31 AM
i have just install this mod but i don't know how to  upload mp3 Files ?? please guide me
Install an ftp client software in your pc and the rest is easy.

BobDoyle

Quote

I made a modified version for my demo site with image parameter but you can add any parameter you want at your site and if you are kind enough you can post here any change you make as long it is for the non-commercial version of jw5.
Yes you can do changes in the code to point to your licensed JWPlayer.

I may have given the impression that I would actually know how to add parameters through modification of code. I can probably figure out how to hard code specific values, but not how to modify the code so I could do something like [jwp image=hxxp:xxxx [nonactive] 200,200]

If you have modified code to do something like this, where would I find an example of it? If I could see it I might have enough knowledge to use that as a start to add other parameters as needed.

nikan

You can add parameters inside the [jwp=425,344] like this [jwp=width,height,image] and add them in the code.
To add preview image use this code:

SMF 2

/Sources/Subs-Editor.php
array(
'image' => 'jwp',
'code' => 'jwp',
'before' => '[jwp=width,height,image]',
'after' => '[/jwp]',
'description' => $txt['jwplayer']
),

/Sources/Subs.php
array(
'tag' => 'jwp',
'type' => 'unparsed_commas_content',       
'content' => '<object type="application/x-shockwave-flash" data="' . $settings['default_theme_url'] . '/player.swf" width="$2" height="$3"><param name="movie" value="' . $settings['default_theme_url'] . '/player.swf" /><param name="AllowFullScreen" value="true" /><param name="AllowScriptAccess" value="always" /><param name="WMode" value="transparent" /><param name="FlashVars" value="file=$1&image=$4" />$1</object>',
'validate' => create_function('&$tag, &$data, $disabled', '
if (isset($disabled[\'url\']))
$tag[\'content\'] = \'$1\';
elseif (strpos($data[0], \'http://\') !== 0 && strpos($data[0], \'https://\') !== 0)
$data[0] = \'http://\' . $data[0];
'),
'disabled_content' => '<a href="$1" target="_blank" class="new_win">$1</a>',
),


SMF 1

/Themes/default/Post.template.php
'jwp' => array('code' => 'jwp', 'before' => '[jwp=width,height,image]', 'after' => '[/jwp]', 'description' => $txt['jwplayer']),
/Sources/Subs.php
array(
'tag' => 'jwp',
'type' => 'unparsed_commas_content',       
'content' => '<object type="application/x-shockwave-flash" data="' . $settings['default_theme_url'] . '/player.swf" width="$2" height="$3"><param name="movie" value="' . $settings['default_theme_url'] . '/player.swf" /><param name="AllowFullScreen" value="true" /><param name="AllowScriptAccess" value="always" /><param name="WMode" value="transparent" /><param name="FlashVars" value="file=$1&image=$4" />$1</object>',
'validate' => create_function('&$tag, &$data, $disabled', '
if (isset($disabled[\'url\']))
$tag[\'content\'] = \'$1\';
elseif (strpos($data[0], \'http://\') !== 0 && strpos($data[0], \'https://\') !== 0)
$data[0] = \'http://\' . $data[0];
'),
'disabled_content' => '<a href="$1" target="_blank">$1</a>',
),

- danny

nikan,

was checking my error log and i'm getting something strange listed.

8: Undefined variable: settings
File: /home/xxxxxx/public_html/Sources/Subs.php
Line: 1294


which points to:
array(
'tag' => 'jwp',
'type' => 'unparsed_commas_content',
'test' => '\d+,\d+\]',       
'content' => '<object type="application/x-shockwave-flash" data="' . $settings['default_theme_url'] . '/player.swf" width="$2" height="$3"><param name="movie" value="' . $settings['default_theme_url'] . '/player.swf" /><param name="AllowFullScreen" value="true" /><param name="AllowScriptAccess" value="always" /><param name="WMode" value="transparent" /><param name="FlashVars" value="file=$1" />$1</object>',
'validate' => create_function('&$tag, &$data, $disabled', '
if (isset($disabled[\'url\']))
$tag[\'content\'] = \'$1\';
elseif (strpos($data[0], \'http://\') !== 0 && strpos($data[0], \'https://\') !== 0)
$data[0] = \'http://\' . $data[0];
'),
'disabled_content' => '<a href="$1" target="_blank">$1</a>',
),


specifically, line 1294 is:

'content' => '<object type="application/x-shockwave-flash" data="' . $settings['default_theme_url'] . '/player.swf" width="$2" height="$3"><param name="movie" value="' . $settings['default_theme_url'] . '/player.swf" /><param name="AllowFullScreen" value="true" /><param name="AllowScriptAccess" value="always" /><param name="WMode" value="transparent" /><param name="FlashVars" value="file=$1" />$1</object>',

any clue what this is about?

nikan

June 02, 2010, 01:01:36 AM #14 Last Edit: June 02, 2010, 01:08:04 AM by nikan
Edit file Sources/Subs.php

Find:
global $txt, $scripturl, $context, $modSettings, $user_info;

Replace:
global $txt, $scripturl, $context, $modSettings, $user_info, $settings;

- danny

i think that was it. :)

thank you!

simmi2121

its like i want to add mp3 player on my site with my playlist .... m unable to do it ...  i want it on my main index ... and the playlist + song i will put it in my hosting area ... so that it can directly play on site ... in simply i want a simple media player for my main page

i think JW player of works in posting area only ?

nikan

Yes, this mod is only for posting area.
If you have installed JW Player mod create a html or php block from your portal and put the necessary code inside it.
Use this wizard to get the code.

simmi2121

very thanks 4 replying my dear bro .... but bro i want on my main page ... is there any player in ur knowledge bro that plays music on my main index page


nikan

If you haven't got a portal mod installed you must put the code of the JW Player in the index.template.php

Advertisement: