2014. 5. 25. 16:19

안녕하세요?

지난 jwplayer만들기에 이어 이번엔 한번에 xml를 통합하여 보겠습니다

준비물: jwplayer 소스(파일첨부 했습니다), xml파일 외부링크 3.16버전(playlist.xml) , Adobe Flash CS 6(다른버전이라도 됨. 필자가 Adobe Flash CS6 를 사용)

이렇게 있으면 준비 끝입니다 S

 

일단 압축 푸시고 mediaplayer-3-16\source 에 들어가시면 이렇게 있을겁니다

이렇게 정상적으로 압축이 풀렸다면

 

 

이렇게 있습니다

보시면 Kroeger_563.ttf 라는 폰트가 있는데 이 폰트가 설치되지 않았다면 설치해주세요

설치방법은 C:\Windows\Fonts

설치하셨다면 이제 source\com\jeroenwijering\players\MediaPlayer.as 입니다

 

 

 

여시면 대충 이렇게 열립니다

여기서 수정할건..

 

private var config:Objec.t = { // 오브젝트 단어 못쓰네
clip:undefined,
height:260, // 높이 조절(임시값. 수정안하는걸 권장)
width:320, 너비 조절(임시값. 수정안하는걸 권장)
controlbar:20, (기본값. 수정하지마세요)
displayheight:0 (상단에 이미지를 표시할 공간을 표시. 0일시 미표시)
displaywidth:undefined, (기본값. )

file:undefined,(playlist.xml 외부주소 입력)
fallback:undefined,
image:undefined,
link:undefined,
id:undefined,
type:undefined,
captions:undefined,
audio:undefined,
category:undefined,

frontcolor:0x000000, (글자 색상. RGB 표기)
backcolor:0xffffff, (배경 색상. RGB 표기)
lightcolor:0x000000,(커서댈때 색상. RGB 표기)
screencolor:0x000000,(기본값. 수정하지않는걸 권장)

autoscroll:"false",
largecontrols:"false",
logo:undefined,
searchbar:'true', (상단 검색바 설치 유무. false 하면 미설치. false로 표기하는걸 권장)
showdigits:'true',
showd|o|w|n|l|o|a|d:'false', // 아 ㅅㅂ 다운로드라는 단어 못쓰네
showeq:'false', (상단 랜덤으로 표기되는 이퀄라이저같은걸 표시. 표시할려면 displayheight 값 설정)
showicons:'true',
shownavigation:'true',
showstop:'false',
thumbsinplaylist:'false',(제목이랑 가수이름을 한칸띄워 입력할지 한줄에 다 입력할지를 설정. false로 할시 한줄에 다 표시. 대부분 플레이어가 false 로 사용함)
usefullscreen:'true',
fsbuttonlink:undefined,

autostart:'false', (자동재생 유무. true시 자동재생)
bufferlength:3, (기본값. 수정하지 않는걸 권장)
overstretch:'false',
repeat:'shuffle',
rotatetime:5,
shuffle:'false', (랜덤재생 유무. truet시 랜덤재생)
smoothing:'true',
volume:80, (소리크기 설정. 설정값: 0~ 100)

callback:undefined,
enablejs:'false',
javascriptid:'',
linkfromdisplay:'false',
linktarget:'_blank',
midroll:undefined,
prefix:'',
recommendations:undefined,
searchlink:'http://search.longtail.tv/?q=', (검색바 사용시 이동할 경로)
streamscript:undefined,
useaudio:'true',
usecaptions:'true',
usemute:'false',
usekeys:'true',

abouttxt:'JW Player 3.16', (컨텍스트 내용)
aboutlnk:'http://www.jeroenwijering.com/?about=JW_FLV_Media_Player' (컨텍스트를 누를시 이동할 페이지)
};

 

이정도로 적겠습니다

이렇게 자기 입맛게 설정하셨으면 source\mediaplayer.fla 를 열어서 컴파일 합니다

 

전 대충 이런식으로 했습니다(개조도 좀 했고..)

밑에꺼 베끼지말고 참고용으로 하세요(밑출친 aboutttxt2, aboutlnk2는 제가 새로 값 설정한겁니다. 혹시 플레이어만들때 이 값은 입력하지 마세요)

===================================================

 

/**
* Player that reads all media formats Flash can read.
*
* @author Jeroen Wijering
* @version 1.10
**/


import com.jeroenwijering.players.*;


class com.jeroenwijering.players.MediaPlayer extends AbstractPlayer {


/** Array with all config values **/
private var config:Objec.t = {
clip:undefined,
height:360,
width:420,
controlbar:20,
displayheight:0,
displaywidth:undefined,

file:'http://maplestory.dnip.co.kr/MapleStory.xml',
fallback:undefined,
image:undefined,
link:undefined,
id:undefined,
type:undefined,
captions:undefined,
audio:undefined,
category:undefined,

frontcolor:0xB5DFEF,
backcolor:0x5868A7,
lightcolor:0x0000FF,
screencolor:0x000000,

autoscroll:"false",
largecontrols:"false",
logo:undefined,
searchbar:'false',
showdigits:'true',
showd|ownload:'false',
showeq:'false',
showicons:'true',
shownavigation:'true',
showstop:'false',
thumbsinplaylist:'false',
usefullscreen:'true',
fsbuttonlink:undefined,

autostart:'true',
bufferlength:3,
overstretch:'false',
repeat:'shuffle',
rotatetime:5,
shuffle:'true',
smoothing:'true',
volume:90,

callback:undefined,
enablejs:'false',
javascriptid:'',
linkfromdisplay:'false',
linktarget:'_blank',
midroll:undefined,
prefix:'',
recommendations:undefined,
searchlink:'http://heartbrea.kr/?vid=&mid=bgmstorage&act=IS&is_keyword=',
streamscript:undefined,
useaudio:'true',
usecaptions:'true',
usemute:'false',
usekeys:'true',

abouttxt:'JW Player 3.16',
aboutlnk:'http://www.jeroenwijering.com/?about=JW_FLV_Media_Player',
abouttxt2:'MapleStory OST Player',
aboutlnk2:'http://maplestory.dnip.co.kr'

};


/** Constructor **/
public function MediaPlayer(tgt:MovieClip) {
super(tgt);
};


/** Setup all necessary MCV blocks. **/
private function setupMCV() {
// set controller
controller = new PlayerController(config,feeder);
// set default views
var dpv = new DisplayView(controller,config,feeder);
var vws = new Array(dpv);
if(config['shownavigation'] == "true") {
var cbv = new ControlbarView(controller,config,feeder);
vws.push(cbv);
} else {
config['clip'].controlbar._visible = false;
}
// set optional views
if(config["displayheight"] < config["height"]-config['controlbar']-config['searchbar'] ||
config["displaywidth"] < config["width"]) {
var plv = new PlaylistView(controller,config,feeder);
vws.push(plv);
} else {
config["clip"].playlist._visible =
config["clip"].playlistmask._visible = false;
}
if(config["usekeys"] == "true") {
var ipv = new InputView(controller,config,feeder);
vws.push(ipv);
}
if(config["showeq"] == "true") {
var eqv = new EqualizerView(controller,config,feeder);
vws.push(eqv);
} else {
config["clip"].equalizer._visible = false;
}
var cpv = new CaptionsView(controller,config,feeder);
vws.push(cpv);
if(config['recommendations'] != undefined) {
var rlv = new RecommendationsView(controller,config,feeder);
vws.push(rlv);
} else {
config["clip"].recommendations._visible = false;
}
if(config['searchbar'] > 0) {
var sev = new SearchView(controller,config,feeder);
vws.push(sev);
} else {
config["clip"].search._visible = false;
}
if(config['midroll'] != undefined) {
var mrv = new MidrollView(controller,config,feeder);
vws.push(mrv);
} else {
config["clip"].midroll._visible = false;
}
if(feeder.audio == true) {
var adv = new AudioView(controller,config,feeder,true);
vws.push(adv);
}
if(config["enablejs"] == "true") {
var jsv = new JavascriptView(controller,config,feeder);
vws.push(jsv);
}
if(config["callback"] != undefined) {
var cav = new CallbackView(controller,config,feeder);
vws.push(cav);
}
// set models
var mp3 = new MP3Model(vws,controller,config,feeder,config["clip"]);
var flv = new FLVModel(vws,controller,config,feeder,config["clip"].display.video);
var img = new ImageModel(vws,controller,config,feeder,config["clip"].display.image);
var ytm = new YoutubeModel(vws,controller,config,feeder,config["clip"].display.youtube);
var mds:Array = new Array(mp3,flv,img,ytm);
if(feeder.captions == true) { flv.capView = cpv; }
// start mcv cycle
controller.startMCV(mds);
};


/** Application startup, used for MTASC compilation **/
public static function main() {
var mpl = new MediaPlayer(_root.player);
}


}

 

===================================================

 

 

by 死^死=254

 

jw_mp3_player.zip

 

Posted by 하늘바라KSND
2014. 5. 25. 16:15

네 안녕하세요?

지난jwplayer 제작강좌에 그냥 참고될만한 글을 쓰겠습니다(3.16 버전 기준)


일단 jwplayer 태그가 대충 이런식입니다


<embed width="가로크기" height="세로크기" 
flashvars="config=config.xml 파일주소
&file=playlist.xml 파일주소"
src="http://share.dnip.co.kr/Files/Flash/Player/jw.swf"
type="application/x-shockwave-flash" autostart="true"/>

근데 여기서 config.xml이랑 playlist.xml 파일을 합할수 있습니다
바로 config.xml 파일에 다음과 같이 추가해주면 되는데요..

<file>playlist.xml 파일주소</file>

예제를 보자면

<config>
<allowscriptaccess>always</allowscriptaccess>
<allownetworking>all</allownetworking>
<allowfullscreen>false</allowfullscreen>
<file>playlist.xml 파일주소</file>
<autostart>true</autostart>
<repeat>always</repeat>
<shuffle>true</shuffle>
<icons>false</icons>
<volume>100</volume>
<linktarget>_top</linktarget>
<displayheight>0</displayheight>
<thumbsinplaylist>false</thumbsinplaylist>
<showeq>false</showeq>
<backcolor>0x5868A7</backcolor>
<frontcolor>0xB5DFEF</frontcolor>
<lightcolor>0x0000FF</lightcolor>
<overstretch>false</overstretch>
<usefullscreen>true</usefullscreen>
</config>

대충 위와같이 하면 되는겁니다
이렇게 설정하면 태그는 다음과 같이 줄어들게 됩니다
<embed width="가로크기" height="세로크기"
flashvars="config=config.xml 파일주소" src="http://share.dnip.co.kr/Files/Flash/Player/jw.swf"
type="application/x-shockwave-flash" autostart="true"/>


어때요, 정말 쉽죠?
 

by 死^死=254

Posted by 하늘바라KSND
2014. 5. 25. 16:13

자게에 어떤분이 프레이어 만들고 싶은데 리리슐츠님꺼 보고 못알아보겠다고 해서 다시 올립니다.

최대한 쉽게 풀어놓고 자세하게 설명했습니다

그리고 맨밑에 예제로 플레이어 실행되고 있는데, 듣기 싫으시다면 끄시고 봐주세요...

-------------------------------------------


안녕하세요?

이번 시간엔 jwplayer 를 이용하여 여러 mp3를 재생시켜보겠습니다


준비물: Apache or ngnix(선택), jwplayer(3.16), config.xml, list.xml

jwplayer 3.16: http://share.dnip.co.kr/Files/heartbrea/jw_player316.swf

config 양식: http://share.dnip.co.kr/Files/heartbrea/config.xml

list.xml 양식: http://share.dnip.co.kr/Files/heartbrea/list.xml


여기서 jwplayer는 플레이어 역할을 하고 건들일 필요가 없습니다

config.xml은 제목 그대로 설정 파일입니다. config.xml은 자동 재생, 플레이어 색상, 사운드 크기, 폰트 색상, 순차적 및 랜덤 재생 등... 사람으로 치면 머리겠죠

list.xml은 재생할 음악, 클릭시 이동할 주소, 타이틀을 담당합니다

만약 플레이어를 만들어서 웹에 게시하실땐 이글루스, 티스토리 같은곳에 업로드 하시면 됩니다

파일이름은 임의로 수정이 가능합니다


이제 config.xml를 만들어보겠습니다

양식을 다운받으면 대충 이런식으로 적혀 있을겁니다

-----------------------------------------

<config>
<allowscriptaccess>always</allowscriptaccess>
<allownetworking>all</allownetworking>
<allowfullscreen>false</allowfullscreen>
<autostart>true</autostart>
<repeat>always</repeat>
<shuffle>true</shuffle>
<icons>false</icons>
<volume>100</volume>
<linktarget>_top</linktarget>
<displayheight>0</displayheight>
<thumbsinplaylist>false</thumbsinplaylist>
<showeq>false</showeq>
<backcolor>0x5868A7</backcolor>
<frontcolor>0xB5DFEF</frontcolor>
<lightcolor>0x0000FF</lightcolor>
<overstretch>false</overstretch>
<usefullscreen>true</usefullscreen>
</config>

-----------------------------------------


<allowscriptaccess>always</allowscriptaccess>
<allownetworking>all</allownetworking>
<allowfullscreen>false</allowfullscreen>

이 위에 3개를 이렇게 설정시, >| 누르면 순차적 재생되고, 자동으로 노래가 끝나고 다음 재생으로 넘어갈땐, 랜덤으로 됨.(suffle 값을 ture 기준. 사용안할시, 위에 3개 없애도 무방)



autostart: 자동 재생 유무 설정입니다. true 하면 자동재생, false 하면 수동재생입니다

shuffle: true 설정시 랜덤 재생, flase 설정시 순차적 재생

icons: 아이콘 파일 유무 설정. 현 버전에서 지원되는지는 의문.

volume: 0~100 사이 값으로 설정. 100은 최대 음령

displayheight: 상단에 이미지 표시할 공간을 설정합니다. 0일시 표시가 되지 않습니다(이미지 표시를 할시, list.xml 수정)

showeq: 이퀄라이전가 뭐 그거 막대기 같은거 막 움직이고 하는거. true일시 표시

backcolor: 배경 색상

frontcolor: 맨앞에거 색상

lightcolor: 글자 마우스 커서 대면 색상




list.xml

-----------------------------------------

<?xml version="1.0" encoding="UTF-8" ?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
<title></title>
<info></info>
<trackList>
<track>
<creator></creator>
<title></title>
<location></location>

<image></image>
<link rel="captions"/>
<info></info>
</track>
<track>
<creator></creator>
<title></title>
<location></location>

<image></image>
<link rel="captions"/>
<info></info>
</track>
<track>
<creator></creator>
<title></title>
<location></location>

<image></image>
<link rel="captions"/>
<info></info>
</track>
</trackList>
</playlist>

-----------------------------------------


title: 제목

creator: 앨범재목

location: 음악파일 주소(http)

image: 플레이어 상단 이미지. 표시할시, config.xml displayheight 값 설정. 사용하지않을시

<image></image>

삭제해도 무관.


info: 오른쪽 화살표를 누를시 이동할 주소. 네이버 같은곳에선 통하지 않음. 사용하지 않을 시,

<link rel="captions"/>
<info></info>

둘다 지워도 됨



 

이때 크기는 480x360 로 가정할때 주소는

<embed type="application/x-shockwave-flash" src="jwplayer 주소" 
flashvars
="config=config.xml주소&amp;file=list.xml 주소"
wmode
="transparent" autostart="true" height="360" width="480">


============================================
============================================

이제 예제를 봅시다

config.xml (blog_config.xml로 사용)
-------------
<config>
<allowscriptaccess>always</allowscriptaccess>
<allownetworking>all</allownetworking>
<allowfullscreen>false</allowfullscreen>
<autostart>true</autostart>
<repeat>always</repeat>
<shuffle>true</shuffle>
<icons>false</icons>
<volume>100</volume>
<linktarget>_top</linktarget>
<displayheight>0</displayheight>
<thumbsinplaylist>false</thumbsinplaylist>
<showeq>false</showeq>
<backcolor>0x5868A7</backcolor>
<frontcolor>0xB5DFEF</frontcolor>
<lightcolor>0x0000FF</lightcolor>
<overstretch>false</overstretch>
<usefullscreen>true</usefullscreen>
</config>
--------------

list.xml(blog_list.xml)
--------------
<?xml version="1.0" encoding="UTF-8" ?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
<title>unknown</title>
<info>unknown</info>
<trackList>
<track>
<creator>Fear, and Loathing in Las Vegas</creator>
<title>Burn the Disco Floor with Your “2-step”!!</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/01 - Burn the Disco Floor w...mp3</location>
</track>
<track>
<creator>Fear, and Loathing in Las Vegas</creator>
<title>Love at First Sight</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/04 - Love at First Sight.mp3</location>
</track>
<track>
<creator>SEAMO</creator>
<title>Kimini1nichi1kaisukitoiu</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/01 Kimini1nichi1kaisukitoiu.mp3</location>
</track>
<track>
<creator>Alexander Brandon</creator>
<title>Two Steps</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/01 Two Steps.mp3</location>
</track>
<track>
<creator>Alexander Brandon</creator>
<title>Snowstorm</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/06 - Snowstorm.mp3</location>
</track>
<track>
<creator>Simple Plan</creator>
<title>Take My Hand</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/02 Take My Hand.mp3</location>
</track>
<track>
<creator>Avril Lavigne</creator>
<title>Smile</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/Avril Lavigne - Smile.mp3</location>
</track>
<track>
<creator>DJ Sammy</creator>
<title>Heaven</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/02. DJ Sammy - Heaven.mp3</location>
</track>
<track>
<creator>Ronald Jenkees</creator>
<title>Throwing Fire</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/05._Ronald_Jenkees_-_Throwing_Fire.mp3</location>
</track>
<track>
<creator>Italobrothers</creator>
<title>So Small (Dance Radio Edit)</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/08-italobrothers-so_small_(dance_radio_edit).mp3</location>
</track>
<track>
<creator>Maroon 5</creator>
<title>Payphone</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/02 - Maroon 5 - Payphone.mp3</location>
</track>
<track>
<creator>Boys Like Girls</creator>
<title>The Great Escape</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/Boys Like Girls - The Great Escape.mp3</location>
</track>
<track>
<creator>Dash Berlin</creator>
<title>Go It Alone - Radio Edit</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/01. Dash Berlin - Go It Alone - Radio Edit.mp3</location>
</track>
<track>
<creator>Donkeyboy</creator>
<title>Stay</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/12. Stay.mp3</location>
</track>
<track>
<creator>DJ Manian</creator>
<title>Darren Styles - Outta My Head</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/13.Manian___Darren_Styles_-_Outta_My_Head.mp3</location>
</track>
<track>
<creator>DJ Manian</creator>
<title>Sky</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/32.Manian_-_Sky.mp3</location>
</track>
<track>
<creator>Sascha Grunwaldt</creator>
<title>alles was ich fuhle (cubase) improvised</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/alles_cubase.mp3</location>
</track>
<track>
<creator>David Defeis; Tobias Sammett</creator>
<title>Avantasia - The Final Sacrifice</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/Avantasia - The Final Sacrifice.mp3</location>
</track>
<track>
<creator>B.O.B</creator>
<title>Airplanes (Feint Drum & Bass Remix)</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/B.O.B - Airplanes (Feint Drum & Bass Remix).mp3</location>
</track>
<track>
<creator>Feint</creator>
<title>Clockwork Hearts [forth. Subsphere Records]</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/Feint - Clockwork Hearts [forth. Subsphere Records].mp3</location>
</track>
<track>
<creator>Pendulum</creator>
<title>Encoder</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/pendulum - encoder.mp3</location>
</track>
<track>
<creator>Siren & Sirrus</creator>
<title>Snowfall</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/Siren & Sirrus - Snowfall.mp3</location>
</track>
<track>
<creator>Owl City</creator>
<title>Fireflies</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/09.Owl City-Fireflies.mp3</location>
</track>
<track>
<creator>Owl City</creator>
<title>Honey and The Bee</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/05 - Honey and The Bee.mp3</location>
</track>
<track>
<creator>Sum 41</creator>
<title>Still Waiting</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/Sum 41 - 04. Still Waiting.mp3</location>
</track>
<track>
<creator>Sum 41</creator>
<title>Summer</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/08 - Sum 41 - Summer.mp3</location>
</track>
<track>
<creator>Muse</creator>
<title>New Born</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/03.New Born.mp3</location>
</track>
<track>
<creator>Muse</creator>
<title>Plug In Baby</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/05.Plug In Baby.mp3</location>
</track>
<track>
<creator>Nickelback</creator>
<title>When We Stand Together</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/Nickelback - When We Stand Together.mp3</location>
</track>
<track>
<creator>Usher</creator>
<title>DJ Got Us Fallin' In Love Feat Pitbu</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/Usher - DJ Got Us Fallin' In Love Feat Pitbu.mp3</location>
</track>
<track>
<creator>Green Day</creator>
<title>21 Guns</title>
<location>http://share.dnip.co.kr/Files/blog/bgm/0000/16. 21 Guns.mp3</location>
</track>
</trackList>
</playlist>
------------

주소:
<embed type="application/x-shockwave-flash" src="http://share.dnip.co.kr/Files/Flash/Player/jw.swf" flashvars="config=http://share.dnip.co.kr/Files/Flash/Player/blog_config.xml&amp;file=http://share.dnip.co.kr/Files/Flash/Player/blog_list.xml" wmode="transparent" autostart="true" height="360" width="480">

by 死^死=254

Posted by 하늘바라KSND