Forum moderator: bigblog |
uCoz Community For Webmasters Custom Solutions How to make your personal jw player for youtube videos (for trailers, movies, gameplays etc...) |
How to make your personal jw player for youtube videos |
Many times I found the questions how to make a personal player for playing music, movies etc. from youtube...
Step 1: Follow the Download Link and download the files. (it's free). Create a folder named "player" in your File Manager: Step 2: Unpack the jw player and upload the files [color=blue]jwplayer.js player.swf swfobject.js into the "player" folder: Step 3: I've indicated in the following code what should be replaced by your own links. Code <?if($AUTHOR_SITE$)?><center><script type='text/javascript' src='link to swfobject.js'></script><div id="mediaspace">This text will be replaced</div><script type='text/javascript'> var so = new SWFObject('link to-player.swf','mpl','580','400','9'); so.addParam('allowfullscreen','true'); so.addParam('allowscriptaccess','always'); so.addParam('wmode','opaque'); so.addVariable('image','your image, logo etc'); so.addVariable('file','youtube link'); so.write('mediaspace'); </script></center><?endif?> We will use the field $AUTHOR_SITE$ to automatically add a youtube link. Change the size of the player by changing '580','400','9'. This code can be used in almost all modules, just add it in 'Page with full entry text and associated comments' (best after or before $MESSAGE$). Go to the module in which you add it in Substitution of default phrases--> FORM FOR ADDING NEW ENTRIES TO "( module you have chosen )" MODULE. Change AUTHOR SITE into Youtube link. When you add content you only need to insert a link into the field: and you have your own player for the site (example): If your site is not in English you can add the translation to your player ( for movies ) by adding: Code so.addVariable('plugins', 'captions-2'); so.addVariable('captions.file', '$SOURCE$'); after: Code so.addVariable('file','$AUTHOR_SITE$'); in the player code and use the field $SOURCE$ for your translation (must be in .srt forma). Attachments:
0718736.jpg
(16.6 Kb)
·
6483597.jpg
(40.4 Kb)
·
1423102.jpg
(8.3 Kb)
·
8132302.jpg
(26.2 Kb)
·
6796028.jpg
(34.8 Kb)
|
Quote (Davor24) <?if($AUTHOR_SITE$)?><center><script type='text/javascript' src='$HOME_PAGE_LINK$/player/swfobject.js'></script><div id="mediaspace">This text will be replaced</div><script type='text/javascript'> var so = new SWFObject('$HOME_PAGE_LINK$/player.swf','mpl','580','400','9'); so.addParam('allowfullscreen','true'); so.addParam('allowscriptaccess','always'); so.addParam('wmode','opaque'); so.addVariable('image','your image, logo etc'); so.addVariable('skin','$HOME_PAGE_LINK$/player/player.swf'); so.addVariable('file','http://www.youtube.com/watch?v=$AUTHOR_SITE$'); so.write('mediaspace'); </script></center><?else?> Where tu put this |
belmo996, I believe the code should end in an instead of an else. If you test this and it works I will change the code here in the thread so users will be aware.
Jack of all trades in development, design, strategy.
Working as a Support Engineer. Been here for 13 years and counting. |
Please can someone from admin or moderators of change the code in first post with:
Code <?if($AUTHOR_SITE$)?><center><script type='text/javascript' src='$HOME_PAGE_LINK$/player/swfobject.js'></script><div id="mediaspace">This text will be replaced</div><script type='text/javascript'> var so = new SWFObject('$HOME_PAGE_LINK$/player.swf','mpl','580','400','9'); so.addParam('allowfullscreen','true'); so.addParam('allowscriptaccess','always'); so.addParam('wmode','opaque'); so.addVariable('image','your image, logo etc'); so.addVariable('file','$AUTHOR_SITE$'); so.write('mediaspace'); </script></center><?endif?> I would did it myself but i have no edit option Post edited by Davor24 - Sunday, 2012-07-29, 1:21 PM
|
belmo996, are you using the $AUTHOR_SITE$ field for your video? And you have downloaded the files? For the latter I am just checking, I'm sure you most likely have but some people miss it from time to time.
Davor24, done. Thnx. Jack of all trades in development, design, strategy.
Working as a Support Engineer. Been here for 13 years and counting. |
Paradox, you have change only <?else?> to <?endif?>
plase change the whole code Code so.addVariable('file','http://www.youtube.com/watch?v=$AUTHOR_SITE$'); to Code so.addVariable('file','$AUTHOR_SITE$'); in working with both options but for first must used youtube ID and for second youtube link ( i think the second option is easier for users )... or just change part where is written to copy the youtube link in the copy youtube ID... I checked the code now and it works 100% belmo996, you probably copied youtube link insted youtube ID... Post edited by Davor24 - Sunday, 2012-07-29, 1:21 AM
|
Ok,I found where is problem
SWFObject('$HOME_PAGE_LINK$/player.swf','mpl','580','400','9'); I replace with this: SWFObject('$HOME_PAGE_LINK$/player/player.swf','mpl','580','400','9'); but now I have this message(on jw player): Task queue failed at step 3:View setup failed:Error #1069 :/ |
Quote (belmo996) SWFObject('$HOME_PAGE_LINK$/player.swf','mpl','580','400','9'); I replace with this: SWFObject('$HOME_PAGE_LINK$/player/player.swf','mpl','580','400','9'); Links should lead to the file where you upload it i write the code as an example but you should change all off the links for yours... also pay attention if you are using: Quote (Davor24) so.addVariable('file','http://www.youtube.com/watch?v=$AUTHOR_SITE$'); you should put youtube ID ( not link ). Quote (Davor24) so.addVariable('file','$AUTHOR_SITE$'); you should put youtube link... check which one you put in the code... Post edited by Davor24 - Sunday, 2012-07-29, 11:03 AM
|
| |||