Advertisement:

Author Topic: JW Player  (Read 23861 times)

Offline nikan

  • Jr. Member
  • **
  • Posts: 390
JW Player
« on: May 14, 2010, 02:16:29 AM »
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
« Last Edit: June 03, 2013, 02:21:51 PM by nikan »

Offline divecall

  • Jr. Member
  • **
  • Posts: 142
Re: JW Player
« Reply #1 on: May 22, 2010, 08:38:22 AM »
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 ?

Offline vicram10

  • Charter Member
  • SMF Hero
  • *
  • Posts: 6,045
  • Gender: Male
    • vmrm10 on Facebook
    • vicram10 on GitHub
    • vicram10 on LinkedIn
    • @vicram_10 on Twitter
    • Noticias Tecnologicas, Tutoriales e Internet
Re: JW Player
« Reply #2 on: May 22, 2010, 09:06:03 AM »
nice mod...

@divecall

try

In Sources/Subs-Editor.php

Find

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

Replace with

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

and test it

Offline divecall

  • Jr. Member
  • **
  • Posts: 142
Re: JW Player
« Reply #3 on: May 22, 2010, 04:27:45 PM »
Thank you, problem solved...

great mod (and great support !).

Offline vicram10

  • Charter Member
  • SMF Hero
  • *
  • Posts: 6,045
  • Gender: Male
    • vmrm10 on Facebook
    • vicram10 on GitHub
    • vicram10 on LinkedIn
    • @vicram_10 on Twitter
    • Noticias Tecnologicas, Tutoriales e Internet
Re: JW Player
« Reply #4 on: May 22, 2010, 05:36:04 PM »
you're welcome ;)

Online Mick.

  • Customizer
  • SMF Hero
  • *
  • Posts: 5,421
  • Gender: Male
    • idesignSMF on Facebook
    • @idesign360 on Twitter
    • idesignSMF.com
Re: JW Player
« Reply #5 on: May 22, 2010, 05:37:18 PM »
I like this.  Very cool man ;)

Offline gbsothere

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,780
  • I'm a Pappy!
Re: JW Player
« Reply #6 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.
« Last Edit: May 22, 2010, 05:59:47 PM by gbsothere »
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.

Offline nikan

  • Jr. Member
  • **
  • Posts: 390
Re: JW Player
« Reply #7 on: May 23, 2010, 10:05:53 AM »
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

Offline BobDoyle

  • Newbie
  • *
  • Posts: 2
Re: JW Player
« Reply #8 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

Offline jaisi

  • Full Member
  • ***
  • Posts: 518
Re: JW Player
« Reply #9 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

Offline nikan

  • Jr. Member
  • **
  • Posts: 390
Re: JW Player
« Reply #10 on: May 25, 2010, 01:37:37 PM »
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.

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.

Offline BobDoyle

  • Newbie
  • *
  • Posts: 2
Re: JW Player
« Reply #11 on: May 26, 2010, 12:47:20 PM »
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=http://xxxx 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.

Offline nikan

  • Jr. Member
  • **
  • Posts: 390
Re: JW Player
« Reply #12 on: May 26, 2010, 05:27:49 PM »
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
Code: [Select]
array(
'image' => 'jwp',
'code' => 'jwp',
'before' => '[jwp=width,height,image]',
'after' => '[/jwp]',
'description' => $txt['jwplayer']
),
/Sources/Subs.php
Code: [Select]
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
Code: [Select]
'jwp' => array('code' => 'jwp', 'before' => '[jwp=width,height,image]', 'after' => '[/jwp]', 'description' => $txt['jwplayer']),/Sources/Subs.php
Code: [Select]
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>',
),

Offline - danny

  • Jr. Member
  • **
  • Posts: 287
  • Gender: Male
    • The ThirdEye Concept
Re: JW Player
« Reply #13 on: June 01, 2010, 10:40:02 PM »
nikan,

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

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

which points to:
Code: [Select]
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:

Code: [Select]
'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?

Offline nikan

  • Jr. Member
  • **
  • Posts: 390
Re: JW Player
« Reply #14 on: June 02, 2010, 01:01:36 AM »
Edit file Sources/Subs.php

Find:
Code: [Select]
global $txt, $scripturl, $context, $modSettings, $user_info;
Replace:
Code: [Select]
global $txt, $scripturl, $context, $modSettings, $user_info, $settings;
« Last Edit: June 02, 2010, 01:08:04 AM by nikan »

Offline - danny

  • Jr. Member
  • **
  • Posts: 287
  • Gender: Male
    • The ThirdEye Concept
Re: JW Player
« Reply #15 on: June 02, 2010, 10:06:58 PM »
i think that was it. :)

thank you!

Offline simmi2121

  • Semi-Newbie
  • *
  • Posts: 26
Re: JW Player
« Reply #16 on: August 23, 2010, 04:10:55 AM »
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 ?

Offline nikan

  • Jr. Member
  • **
  • Posts: 390
Re: JW Player
« Reply #17 on: August 23, 2010, 10:25:39 AM »
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.

Offline simmi2121

  • Semi-Newbie
  • *
  • Posts: 26
Re: JW Player
« Reply #18 on: August 23, 2010, 10:33:45 AM »
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


Offline nikan

  • Jr. Member
  • **
  • Posts: 390
Re: JW Player
« Reply #19 on: August 24, 2010, 12:34:17 AM »
If you haven't got a portal mod installed you must put the code of the JW Player in the index.template.php