웹마스터 팁
page_full_width">
multimedia file 첨부 시 자동으로 jw player 로 설정
2013.11.27 17:38
simple_jw component 사용하는 내용입니다.
이미지를 제외한 Multimedia file 을 upload 시 default component 를 simple_jw(jwplayer6)로 변경하는 tip입니다.
모바일 & PC 에서 동영상 재생을 쉽게 하기 위함.
1. 기본적으로 쉬운설치에서 editor component simple_jw 설치
2. modules/editor/tpl/js/upload.js 파일 수정
(Default 변경 지정 부분)
upload.js
1 2 3 4 5 | // 이미지외의 경우는 multimedia_link 컴포넌트 연결 /* } else { text.push("<img src=\"common/img/blank.gif\" editor_component=\"multimedia_link\" multimedia_src=\""+file.download_url+"\" width=\"400\" height=\"320\" style=\"display:block;width:400px;height:320px;border:2px dotted #4371B9;background:url(./modules/editor/components/multimedia_link/tpl/multimedia_link_component.gif) no-repeat center;\" auto_start=\"false\" alt=\"\" />"); } */ |
1 | 위에 부분을 아래와 같은 구문으로 변경 |
1 2 3 4 | // simple_jw 연결 부분 } else { text.push( "<img src=\"common/img/blank.gif\" editor_component=\"simple_jw\" simple_jw_src=\"" +file.download_url+ "\" width=\"700\" height=\"500\" style=\"display:block;width:700px;height:500px;border:2px dotted #4371B9;background:url(./modules/editor/components/simple_jw/tpl/simple_jw_component.gif) no-repeat center;\" auto_start=\"false\" alt=\"\" />" ); } |
AXISJ AXUpload5(HTML5) editor 사용시에는 아래와 같이 Default를 변경 할 수 있다.
-Editor Skin 내 파일 수정
Axupload5fornuri.js
1 2 3 4 | // 이미지외의 경우는 multimedia_link 컴포넌트 연결 } else { text.push( "<img src=\"common/img/blank.gif\" editor_component=\"simple_jw\" simple_jw_src=\"" + this .download_url+ "\" width=\"400\" height=\"320\" style=\"display:block;width:400px;height:320px;border:2px dotted #4371B9;background:url(./modules/editor/components/simple_jw/tpl/simple_jw_component.gif) no-repeat center;\" auto_start=\"false\" alt=\"\" />" ); } |
이렇게 하면 multimedia 파일 삽입 시 default 로 simple_jw으로 Component Defalut가 변경.
그리고 업로드를 mp4 파일을 업로드 시킬경우에 Mobile, PC 에서 본문 삽입만으로도 동영상을 재생 가능함.
Mobile 의 경우 simple_jw 에서 mobile size 를 제한하고 있어서, 그부분도 상황에 맞게 수정이 필요할듯 함.
/modules/editor/components/simple_jw/simple_jw.class.php
60 61 62 63 64 65 66 67 68 | preg_match_all( '/(width|height)([^[:digit:]]+)([0-9]+)/i' ,$style,$matches); $width = trim($matches[3][0]); $height = trim($matches[3][1]); if (!$width) $width = 400; if (!$height) $height = 300; if (Mobile::isMobileCheckByAgent()){ $width = 350; $height = 220; } |