묻고답하기

// 안드로이드,윈도우CE,블랙베리 등

var UserAgent = navigator.userAgent;
if (UserAgent.match(/Android|Windows CE|BlackBerry|Symbian|Windows Phone|webOS|Opera Mini|Opera Mobi|POLARIS|IEMobile|lgtelecom|nokia|SonyEricsson/i) != null || UserAgent.match(/LG|SAMSUNG|Samsung/) != null)
{
var $allVideos = jQuery("iframe[src^='http://player.vimeo.com'], iframe[src^='http://www.youtube.com'], iframe[src^='http://www.youtube-nocookie.com'], iframe[src^='http://serviceapi.nmv.naver.com'], embed[src^='http://www.youtube.com'], embed[src^='http://serviceapi.nmv.naver.com'], iframe[src^='https://www.youtube.com'], iframe[src^='https://www.youtube-nocookie.com'], iframe[src^='http://flvs.daum.net'], iframe[src^='http://play.pullbbang.com'], iframe[src^='http://www.gamespot.com'], iframe[src^='http://sbsplayer.sbs.co.kr/'], iframe[src^='http://www.microsoft.com'], iframe[src^='http://dotsub.com'], iframe[src^='http://www.travelro.co.kr'], embed[src^='http://v.egloos.com/v.sk/'], embed[src^='http://api.v.daum.net/'], embed[src^='http://dory.mncast.com/'], embed[src^='http://play.mgoon.com/Video/'], embed[src^='http://doc.mgoon.com/'], embed[src^='http://flvr.pandora.tv/flv2pan/'], embed[src^='http://imgcdn.pandora.tv/'], embed[src^='http://live.afreeca.com'], embed[src^='http://afbbs.afreeca.com'], embed[src^='http://w.blogdoc.nate.com'], embed[src^='http://blogdoc.nate.com'], embed[src^='http://www.musicshake.com/'], embed[src^='http://static.plaync.co.kr'], iframe[src^='http://www.travelro.co.kr'], iframe[src^='http://dotsub.com'], embed[src^='http://videofarm.daum.net'], iframe[src^='http://videofarm.daum.net'], embed[src^='http://fpdownload.macromedia.com'], iframe[src^='http://fpdownload.macromedia.com']"),

$fluidEl = jQuery("body");
 
$allVideos.each(function() {
jQuery(this)
.data('aspectRatio', this.height / this.width)
.removeAttr('height')
.removeAttr('width');
});
 
jQuery(window).resize(function() {
var newWidth = $fluidEl.width();
$allVideos.each(function() {
var $el = jQuery(this);
$el
.width('320') // 가로
.height('240'); // 세로
});
}).resize();

}

// iPod,iPhone 전용

if (UserAgent.match(/iPhone|iPod/i) != null)

{
var $allVideos = jQuery("iframe[src^='http://player.vimeo.com'], iframe[src^='http://www.youtube.com'], iframe[src^='http://www.youtube-nocookie.com'], iframe[src^='http://serviceapi.nmv.naver.com'], embed[src^='http://www.youtube.com'], embed[src^='http://serviceapi.nmv.naver.com'], iframe[src^='https://www.youtube.com'], iframe[src^='https://www.youtube-nocookie.com'], iframe[src^='http://flvs.daum.net'], iframe[src^='http://play.pullbbang.com'], iframe[src^='http://www.gamespot.com'], iframe[src^='http://sbsplayer.sbs.co.kr/'], iframe[src^='http://www.microsoft.com'], iframe[src^='http://dotsub.com'], iframe[src^='http://www.travelro.co.kr'], embed[src^='http://v.egloos.com/v.sk/'], embed[src^='http://api.v.daum.net/'], embed[src^='http://dory.mncast.com/'], embed[src^='http://play.mgoon.com/Video/'], embed[src^='http://doc.mgoon.com/'], embed[src^='http://flvr.pandora.tv/flv2pan/'], embed[src^='http://imgcdn.pandora.tv/'], embed[src^='http://live.afreeca.com'], embed[src^='http://afbbs.afreeca.com'], embed[src^='http://w.blogdoc.nate.com'], embed[src^='http://blogdoc.nate.com'], embed[src^='http://www.musicshake.com/'], embed[src^='http://static.plaync.co.kr'], iframe[src^='http://www.travelro.co.kr'], iframe[src^='http://dotsub.com'], embed[src^='http://videofarm.daum.net'], iframe[src^='http://videofarm.daum.net'], embed[src^='http://fpdownload.macromedia.com'], iframe[src^='http://fpdownload.macromedia.com']"),

$fluidEl = jQuery("body");
 
$allVideos.each(function() {
jQuery(this)
.data('aspectRatio', this.height / this.width)
.removeAttr('height')
.removeAttr('width');
});
 
jQuery(window).resize(function() {
var newWidth = $fluidEl.width();
$allVideos.each(function() {
var $el = jQuery(this);
$el
.width('300') // 가로
.height('225'); // 세로
});
}).resize();
}

// 그외

else {
var $allVideos = jQuery("iframe[src^='http://player.vimeo.com'], iframe[src^='http://www.youtube.com'], iframe[src^='http://www.youtube-nocookie.com'], iframe[src^='http://serviceapi.nmv.naver.com'], embed[src^='http://www.youtube.com'], embed[src^='http://serviceapi.nmv.naver.com'], iframe[src^='https://www.youtube.com'], iframe[src^='https://www.youtube-nocookie.com'], iframe[src^='http://flvs.daum.net'], iframe[src^='http://play.pullbbang.com'], iframe[src^='http://www.gamespot.com'], iframe[src^='http://sbsplayer.sbs.co.kr/'], iframe[src^='http://www.microsoft.com'], iframe[src^='http://dotsub.com'], iframe[src^='http://www.travelro.co.kr'], embed[src^='http://v.egloos.com/v.sk/'], embed[src^='http://api.v.daum.net/'], embed[src^='http://dory.mncast.com/'], embed[src^='http://play.mgoon.com/Video/'], embed[src^='http://doc.mgoon.com/'], embed[src^='http://flvr.pandora.tv/flv2pan/'], embed[src^='http://imgcdn.pandora.tv/'], embed[src^='http://live.afreeca.com'], embed[src^='http://afbbs.afreeca.com'], embed[src^='http://w.blogdoc.nate.com'], embed[src^='http://blogdoc.nate.com'], embed[src^='http://www.musicshake.com/'], embed[src^='http://static.plaync.co.kr'], iframe[src^='http://www.travelro.co.kr'], iframe[src^='http://dotsub.com'], embed[src^='http://videofarm.daum.net'], iframe[src^='http://videofarm.daum.net'], embed[src^='http://fpdownload.macromedia.com'], iframe[src^='http://fpdownload.macromedia.com']"),

$fluidEl = jQuery("body");
 
$allVideos.each(function() {
jQuery(this)
.data('aspectRatio', this.height / this.width)
.removeAttr('height')
.removeAttr('width');
});
 
jQuery(window).resize(function() {
var newWidth = $fluidEl.width();
$allVideos.each(function() {
var $el = jQuery(this);
$el
.width('890') // 가로
.height('501'); // 세로
});
}).resize();
}



PC에서는 890 501 사이즈로 잘 조절되는데 모바일에서는 기기를 인식못합니다


유저에이전트 부분이 잘못된건가요...?




애드온 : (iframe,embed 동영상 자동 리사이징)

iframe,embed 동영상 자동 리사이징

글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
탄탄 메일 인증 문제 file  
wmrcjs 초보자에게 간절한 도움 부탁드립니다ㅠㅠ 로그인 문제입니다!!  
임실치즈 답변달기 기능 ?? 게시판 [7] 2014.05.22 by 애니즌
환생77 레이아웃 스킨 xdt_style_b를 사용하는데요..서브메뉴출력에.. file  
파워뭉치 특정 게시판에서 글쓰고 원하는 페이지로 이동하는 방법 좀 부탁드려요^^  
환생77 푸터부분에...메뉴를 넣고싶은데... [8] file 2014.05.22 by 로이조52
나의해 회원가입 휴대폰인증 조언부탁드립니다 [2] file 2014.05.22 by 나의해
XE모듈 물어봅니다..CafeXe [6] file 2014.05.22 by XE모듈
로양 제이쿼리 충돌문제 [3] 2014.05.22 by 애니즌
로양 관리자페이지 깨짐 [4] file 2014.05.22 by 로양
로양 외부에서 각각의 탭에 링크 걸기  
브라보 게시판 글쓰기가 안됩니다  
송아지왕아톰학생 위젯 올릴때 위젯페이지 가로크기 조절을하고싶습니다. [2] file 2014.05.22 by 낮술1잔
울뜨라 통합검색 게시판 설정 어디서 하나요? [1] 2014.05.22 by 울뜨라
백년여우 XE 최초 설치 후.. [2] file 2014.05.22 by 이즈야
zartin 방문자 현황 위젯 [2] file 2014.05.22 by zartin
김박이 스팸 끌 해결 방법? [6] file 2014.05.22 by GG
putty URL변경 방법 (제로보드와 php 사용) [6] 2014.05.22 by putty
ggem24 서브 분류 위치를 바꿀수 있나요 [1] 2014.05.22 by Double'U'
xe_마니 SSL 항시적용후 부터 관리자 로그인이 안됩니다@@ [2] 2014.05.22 by xe_마니