묻고답하기

// 안드로이드,윈도우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 남기남
킹오아짱 제가 아주 획기적인 아이디어가 있는데요 [4] 2008.02.15 by 수지천
1000사랑 저만 이러는 겁니까? [1] 2008.02.15 by 된장맛껌
레베로프 파일첨부와 js 충돌에 관해  
고독의요새 rewrite_mod와 Optimize를 체크하면 이렇게 됩니다. file  
나경한 갤러리로 바꾸면 오른쪽 공간이 너무 넓어지네요 [3] file 2008.02.15 by 나경한
레베로프 textarea에 내용 출력하기 [1] 2008.02.16 by 레베로프
무적한승 설치오류 문제입니다.  
우갱™ 글쓰기 폼에 미리 내용을 나오게 하려면... [2] 2008.02.16 by 대웅
list65 게시판 사진 결과물 리사이즈 문제  
하림 첨부파일 비회원 다운로드 ... [1] 2008.02.16 by 대암지기
트릭월드 게시판 권한 관리 적용이 안됩니다...orz [2] 2008.02.16 by 트릭월드
5star 외부페이지에 에디터를 달고 싶습니다..  
이태화143 최근게시물(웹진) 질문있습니다 [2] 2008.02.16 by SMaker
호아금 댓글을 작성자와 관리자만이 볼 수 있게... [3] 2008.02.16 by 대암지기
필드린。 기본스킨에서 번호/추천/작성자 칸의 폭을 줄이고 싶습니다. [2] 2008.02.16 by 필드린。
불꽃투혼 이미지 버튼 등록 및 이미지 삽입 [2] file 2008.02.16 by 불꽃투혼
우헤헤446 비밀글 일경우 목록에 댓글 갯수가 뜨지 않나요? [2] 2008.02.24 by neo
필드린。 코멘트 쓰기에서 위지윅 에디터를 제거하고 싶습니다. [3] 2008.02.16 by 대암지기
오타왕자 게시판 분류기능을 사용할때 분류선택을 하지 않고도 글을 쓸수 있게하는 설정이.. [2] file 2008.02.17 by 오타왕자
이정현307 카운터에 관해 질문드립니다. [1] 2008.02.17 by 백성찬