비디오 재생문제 좀 채택완료
zkdlf
8년 전
조회 4,263
모바일에서입니다^^
div 안에 video 가 있으니 작동이 안되는데
div 없에고
만있으니 자동재생되네요
왜 그러는건가요?
</p><p> </p><p><? </p><p>error_reporting(E_ALL);
ini_set("display_errors", 1);
$dirname = array("department store", "video");
$entrys = array();
foreach( $dirname as $val ) {
$path = "./". $val ;
$entrys[$val] = array();
if( is_dir($path) ) {
$dirs = dir($path);
while( false !== ($entry = $dirs->read()) ) {
if(($entry != '.') && ($entry != '..')) {
$entrys[$val][] = $entry;
}
}
$dirs->close();
}
}
?>
<script type="text/javascript">
function tab_change(num) {
var tab_content;
for (var i=1; i<=9; i++)
{
tab_content = document.getElementById("tab_content"+i);
if (i==num) {
tab_content.style.display = "";
}
else {
tab_content.style.display = "none";
}
}
}
</script>
<div id="shop"> </p><p><?
for( $i=0, $cnt=count($dirname); $i < $cnt; $i ++ ) {
?>
<div id="tab_content6" style="display:none;">
<video src="/1111/0.mp4" playsinline loop muted autoplay></video></p><p></div>
<?
}
?> </p><p></div> </p><p> </p><p>
댓글을 작성하려면 로그인이 필요합니다.
답변 4개
채택된 답변
+20 포인트
8년 전
display:none 되면 객체가 없기 때문에 video 태그가 정상 작동하지 않습니다.
display 방식이 아닌 resize 방식으로 하세요.
로그인 후 평가할 수 있습니다
답변에 대한 댓글 2개
z
zkdlf
8년 전
�
천사별
8년 전
resize 방식으로 크기를 0으로 줄여 보이지 않게 했다가가 버튼을 눌러 보여줄려고 할때 크기를 늘려서 객체를 보이게 하라는 의미입니다.
댓글을 작성하려면 로그인이 필요합니다.
8년 전
style="width:0; height:0; overflow:hidden;"
style 부분은 이렇게 바꿔 보세요.
스크립트는
if(i == num) {
tab_content.style.removeProperty("overflow");
} else {
tab_content.style.overflow = "hidden";
}
이런 식의 편법으로도 될 것 같네요.
로그인 후 평가할 수 있습니다
답변에 대한 댓글 1개
z
zkdlf
8년 전
왕계란님 도와주세요^^;;
resize를 넣으니 가능하네요 ㅋㅋ 그런데 버튼을 클릭하기전에 미리 나와서 재생이되고있어요
하지만 버튼을 누르면 동영상이 나오긴해요
미리나와있지않고 버튼을 누르면 나오게는 안되나요?
if (i==num) {
tab_content.style.display = "";
}
else {
tab_content.style.resize= "none";
}
}
}
$(function(){
$("#tab_content6").show();
});
</script>
<div id="shop">
<?
for( $i=0, $cnt=count($dirname); $i < $cnt; $i ++ ) {
?>
<input type="button" name="tab_radio" value="<?=$dirname[$i]?>" style="width:115px" onclick="tab_change(<?=($i+1)?>)" />
<div id="tab_content6" style=" display:none; ">
<video src="/1111/0.mp4" class="v01" style="height:500px;"playsinline loop muted autoplay type="mp4" alt="map"/>
</div>
<?
}
?>
</div>
resize를 넣으니 가능하네요 ㅋㅋ 그런데 버튼을 클릭하기전에 미리 나와서 재생이되고있어요
하지만 버튼을 누르면 동영상이 나오긴해요
미리나와있지않고 버튼을 누르면 나오게는 안되나요?
if (i==num) {
tab_content.style.display = "";
}
else {
tab_content.style.resize= "none";
}
}
}
$(function(){
$("#tab_content6").show();
});
</script>
<div id="shop">
<?
for( $i=0, $cnt=count($dirname); $i < $cnt; $i ++ ) {
?>
<input type="button" name="tab_radio" value="<?=$dirname[$i]?>" style="width:115px" onclick="tab_change(<?=($i+1)?>)" />
<div id="tab_content6" style=" display:none; ">
<video src="/1111/0.mp4" class="v01" style="height:500px;"playsinline loop muted autoplay type="mp4" alt="map"/>
</div>
<?
}
?>
</div>
댓글을 작성하려면 로그인이 필요합니다.
답변에 대한 댓글 1개
z
zkdlf
8년 전
밑에처럼해봤는데 똑같아요^^ 이미지처럼 꼼짝도안해요 동영상인데 ㅋ
resize를 넣으니 가능하네요 ㅋㅋ 그런데 버튼을 클릭하기전에 미리 나와서 재생이되고있어요
하지만 버튼을 누르면 동영상이 나오긴해요
미리나와있지않고 버튼을 누르면 나오게는 안되나요?
if (i==num) {
tab_content.style.display = "";
}
else {
tab_content.style.resize= "none";
}
}
}
$(function(){
$("#tab_content6").show();
});
</script>
<div id="shop">
<?
for( $i=0, $cnt=count($dirname); $i < $cnt; $i ++ ) {
?>
<input type="button" name="tab_radio" value="<?=$dirname[$i]?>" style="width:115px" onclick="tab_change(<?=($i+1)?>)" />
<div id="tab_content6" style=" display:none; ">
<video src="/sightseeing_list/list/dongdaegustation(shinsegae)/video/0.mp4" class="v01" style="height:500px;"playsinline loop muted autoplay type="mp4" alt="map"/>
</div>
<?
}
?>
</div>
resize를 넣으니 가능하네요 ㅋㅋ 그런데 버튼을 클릭하기전에 미리 나와서 재생이되고있어요
하지만 버튼을 누르면 동영상이 나오긴해요
미리나와있지않고 버튼을 누르면 나오게는 안되나요?
if (i==num) {
tab_content.style.display = "";
}
else {
tab_content.style.resize= "none";
}
}
}
$(function(){
$("#tab_content6").show();
});
</script>
<div id="shop">
<?
for( $i=0, $cnt=count($dirname); $i < $cnt; $i ++ ) {
?>
<input type="button" name="tab_radio" value="<?=$dirname[$i]?>" style="width:115px" onclick="tab_change(<?=($i+1)?>)" />
<div id="tab_content6" style=" display:none; ">
<video src="/sightseeing_list/list/dongdaegustation(shinsegae)/video/0.mp4" class="v01" style="height:500px;"playsinline loop muted autoplay type="mp4" alt="map"/>
</div>
<?
}
?>
</div>
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
<video src="/sightseeing_list/list/dongdaegustation(shinsegae)/video/0.mp4" class="v01" style="height:500px;"playsinline loop muted autoplay type="mp4" alt="map"/>
</div>
이런식으로 하닌까 tab_content6 버튼안에 들어가있지않고 밖으로 나와있는데요^^;;
버튼을 누르면 보이게하는거거든요