<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>제이쿼리 모바일 연습</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css"/>
<style>
</style>
<script src="http://code.jquery.com/jquery.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
<script type="text/javascript">
var init = function(){
/*
$("#playBtn").click(function(){
$("#audio1")[0].play();
});
$("#pauseBtn").click(function(){
$("#audio1")[0].pause();
});
*/
$("#playBtn").click(function(){
$("#video1")[0].play();
});
$("#pauseBtn").click(function(){
$("#video1")[0].pause();
});
var volume = 0.5;
/*
$("#vupBtn").click(function(){
volume = volume+0.1;
if(volume > 1) volume = 1;
$("#audio1")[0].volume = volume;
});
$("#vdownBtn").click(function(){
volume = volume - 0.1;
if(volume<0) volume = 0;
$("#audio1")[0].volume=volume;
});
*/
$("#vupBtn").click(function(){
volume = volume+0.1;
if(volume > 1) volume = 1;
$("#video1")[0].volume = volume;
});
$("#vdownBtn").click(function(){
volume = volume - 0.1;
if(volume<0) volume = 0;
$("#video1")[0].volume=volume;
});
}
$(document).bind("pageinit", init);
</script>
</head>
<!--
오디오 속성
autoplay : 자동으로 재생
controls : 컨트롤러를 보여준다.
loop : 반복 재생
비디오 속성
autoplay : 자동으로 재생
controls : 컨트롤러를 보여준다.
-->
<body>
<div data-role="page" id="firstPg">
<div data-role="header" data-position="fixed" id="header">
<h3>미디어 재생</h3>
</div><!-- header -->
<div role="main" class="ui-content">
<!-- <audio id="audio1" controls style="width:100%">
<source src="./sampleAudio.mp3" type="audio/mpeg" />
HTML5 Audio를 지원하지 않는 브라우저 입니다...
</audio>
-->
<video id="video1" controls>
<source src="./sampleVideo.mp4" width="100%"/>
</video>
<div class="ui-grid-a">
<div class="ui-block-a"><button id="playBtn">시작</button></div>
<div class="ui-block-b"><button id="pauseBtn">중지</button></div>
<div class="ui-block-a"><button id="vupBtn">볼륨업</button></div>
<div class="ui-block-b"><button id="vdownBtn">볼륨다운</button></div>
</div>
</div><!-- main -->
<div data-role="footer" data-position="fixed">
<h3>footer</h3>
</div><!-- footer -->
</div><!-- page1 -->
</body>
</html>
'기존카테고리 > 하이브리드앱' 카테고리의 다른 글
디바이스 방향계 (0) | 2017.11.04 |
---|---|
applicaton cache (0) | 2017.11.04 |
구글 MAP API (0) | 2017.11.04 |
[jQuery Mobile] GeoLocation (0) | 2017.11.03 |
[jQuery Mobile] 세션스토리지, 로컬스토리지 (0) | 2017.11.03 |