[Day6] HTML 6 [11/9]

 

--๋ณต์Šต--

1. ํ™”๋ฉด ๊ตฌํ˜„

header / row / footer

<style>
  *{
     box-sizing: border-box;
  }
  
  html{
    font-family:"Lucida Sans", sans-serif;
  }
  
  /* .ํด๋ž˜์Šค๋ช… */
  /* #์•„์ด๋””๋ช… */
  .header{
    background-color: #9933cc;
    color:white;
    padding: 15px;
  }
  .footer{
     background-color: #0099cc;
    color:#ffffff;
    padding: 15px;
    text-align: center;
    font-size: 12px;
  }
  
  .row::after{
     content: "";
     display: table;
     clear: both;
  }
  
  /*
  css selector  60๊ฐ€์ง€
  [์†์„ฑ=์†์„ฑ๊ฐ’]{
  }
  */
  [class*="col-"]{
     float:right;
     padding: 15px;
  }
</style>

- class*="col-" : col-์ด ๋“ค์–ด๊ฐ€์žˆ๋Š” ํด๋ž˜์Šค ์ „๋ถ€

- body ๋ง๊ณ  html์— ์ค˜๋„ ๋จ

- ํฐํŠธ ๊ณต๋ฐฑ์žˆ์œผ๋ฉด "" ๋ฌถ์–ด์ฃผ๊ธฐ

- row-footer ๋ถ™์–ด์žˆ๊ธฐ ๋•Œ๋ฌธ์— row::after ์ถ”๊ฐ€

<style>
  /* css selector   >   ๊ณต๋ฐฑ */
  .menu > ul{         /*  ์ง๊ณ„์ž์‹ O, ํ›„์† X */
     list-style-type: none;
     padding: 0;
     margin:  0;
  }
  .menu li{             /*  ์ง๊ณ„์ž์‹ O, ํ›„์† O */
     background-color: #33b5e5;
     margin-bottom: 7px;
     padding: 8px;
     color: white;
     /* ๋ฐ•์Šค ๊ทธ๋ฆผ์ž ํšจ๊ณผ */
     box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
  }
  
  .menu li:hover{
    background-color: #0099cc;
  }
  
  .aside{
     background-color: #33b5e5;
     text-align:center;
     font-size:14px;
     padding: 15px;
     color: white;
     /* ๋ฐ•์Šค ๊ทธ๋ฆผ์ž ํšจ๊ณผ */
     box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
  }
</style>

 - ์ง๊ณ„์ž์‹(>), ํ›„์†(๊ณต๋ฐฑ)

 

[๋ฐ˜์‘ํ˜• ์›น]

<style>
  /* mobile phone */
   [class*="col-"]{
      width: 100%;
   } 
      
   /* tablets */
   @media only screen and ( min-width:600px ){
        .col-s-3 {width: 25%;}
        .col-s-9 {width: 75%;}
        .col-s-12 {width: 100%;}
   }
   
     /* desktop */
   @media only screen and ( min-width:768px ){
        .col-3 {width: 25%;}
        .col-6 {width: 50%;}
   } 
</style>

- media only screen : ํ™”๋ฉด์— ์ถœ๋ ฅํ• ๋•Œ๋งŒ

<div class="header">
		<h1>Chania</h1>
	</div>
	<div class="row">
		<div class="col-3 col-s-3 menu">
			<ul>
				<li>The Flight</li>
				<li>The City</li>
				<li>The Island</li>
				<li>The Food</li>
			</ul>
		</div>
		<div class="col-6 col-s-9">
			<h1>The City</h1>
			<p>Chania is the capital of the Chania region on the island of
				Crete. The city can be divided in two parts, the old town and the
				modern city.</p>
		</div>
		<div class="col-3 col-s-12">
		   <div class="aside">
		      <h2>What?</h2>
		      <p>Chania is a city on the island of Crete.</p>
		      <h2>Where?</h2>
		      <p>Crete is a Greek island in the Mediterranean Sea.</p>
		      <h2>How?</h2>
		      <p>You can reach Chania airport from all over Europe.</p>
		   </div>
		</div>
	</div>
	<div class="footer">
		<p>Resize the browser window to see how the content respond to the
			resizing.</p>
	</div>

 

 

2. ์ด๋ฆ„๊ณผ ๋‚˜์ด๋ฅผ ์ž…๋ ฅ๋ฐ›์•„์„œ ์ž…๋ ฅ๋ฐ›์€ ์ด๋ฆ„๊ณผ ๋‚˜์ด๋ฅผ ์ถœ๋ ฅํ•˜๋Š” ์ฝ”๋”ฉ์„ ํ•˜์„ธ์š”. 

<form action="ex02_ok.jsp" method="get">
 <label for="name">์ด๋ฆ„ </label> <input type="text" id="name" name="name"  autofocus="autofocus" value="ํ™๊ธธ๋™"><br>
 <label for="age">๋‚˜์ด </label> <input type="text" id="age" name="age" value="20"><br>

 <input type="submit">
 <input type="reset">
</form>
<%
    // ?name=ํ™๊ธธ๋™&age=20
    String name = request.getParameter("name");
    int age = Integer.parseInt( request.getParameter("age") );  // "20" -> 20    
%>

์ด๋ฆ„ : <%= name %><br>
<%-- jsp ์ฃผ์„์ฒ˜๋ฆฌ
๋‚˜์ด : <%= age %> <br>
 --%>

<form action="" method="post" enctype="multipart/form-data">
  <!-- ๋‚จ์ž/์—ฌ์ž  ๋‘ ๊ฐ€์ง€ ๊ฐ’ ์ค‘์—  ๋ฐ˜๋“œ์‹œ  ํ•˜๋‚˜๋งŒ ์„ ํƒํ•  ๋•Œ : ๋ผ๋””์˜ค ๋ฒ„ํŠผ -->
  <!-- ์ฒดํฌ๋ฐ•์Šค  : ์—ฌ๋Ÿฌ ๊ฐ€์ง€ ์ค‘์— 0, ์—ฌ๋Ÿฌ ๊ฐœ๋ฅผ ์„ ํƒํ•  ๋•Œ-->
  
  <!-- ๊ทธ๋ฃน ๋ฌถ์–ด์ฃผ๋Š” ์ฒ˜๋ฆฌ ์†์„ฑ : name -->
  ์„ฑ๋ณ„ : 
  <input type="radio"  name="gender" value="m"  checked="checked">๋‚จ์ž
  <input type="radio"  name="gender"  value="w">์—ฌ์ž
  <br>
  ์ข‹์•„ํ•˜๋Š” ๊ณผ๋ชฉ ์„ ํƒ ? 
  <br>
  <input type="checkbox" name="fsubject" value="kor">๊ตญ์–ด
  <input type="checkbox" name="fsubject" value="eng">์˜์–ด
  <input type="checkbox" name="fsubject" value="mat">์ˆ˜ํ•™
  <input type="checkbox" name="fsubject" value="pe">์ฒด์œก

  <br>
  ๊ฒŒ์‹œ๊ธ€ ์ œ๋ชฉ : <input type="text"  name="title" size="50"  style="border:1px solid gray;width:300px"><br>
  <!-- ํ•œ์ค„ X, ์—ฌ๋Ÿฌ ์ค„  -->
  ๊ฒŒ์‹œ๊ธ€ ๋‚ด์šฉ :  <textarea rows="10" cols="50"></textarea> <br>
  <br>
  <!-- ( ๊ธฐ์–ต ) ์ฒจ๋ถ€ํŒŒ์ผ ์žˆ๋Š” ๊ฒฝ์šฐ์—๋Š” form ํƒœ๊ทธ์˜ method="post" ๋ผ์•ผ ๋œ๋‹ค.  -->
  <!-- ๊ฐœ๋ฐœ์ž ์ง์ ‘ ์„œ๋ฒ„ ์ฒจ๋ถ€(์ „์†ก)๋œ ํŒŒ์ผ์„  ์ €์žฅ ๋˜๋Š” ํŒŒ์ผ์—…๋กœ๋“œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์‚ฌ์šฉ -->
  ์ฒจ๋ถ€ํŒŒ์ผ : <input type="file" name="attachFile"><br>
  ์ฒจ๋ถ€ํŒŒ์ผ : <input type="file" name="attachFile"><br>
  ์ฒจ๋ถ€ํŒŒ์ผ : <input type="file" name="attachFile"><br>
  ์ฒจ๋ถ€ํŒŒ์ผ : <input type="file" name="attachFile"><br>
  <br>
  ๋ฉ€ํ‹ฐ ์ฒจ๋ถ€ ํŒŒ์ผ : <input type="file" name="attachFile"  multiple="multiple"><br>
  <input type="submit">
</form>

- radio : ๋‘๊ฐ€์ง€๊ฐ’ ์ค‘์— ํ•˜๋‚˜ ๋ฐ˜๋“œ์‹œ ์ฒดํฌ 

- checkbox : ์—ฌ๋Ÿฌ๊ฐ€์ง€์ค‘์— ์—ฌ๋Ÿฌ๊ฐœ

- ์ฒจ๋ถ€ ํŒŒ์ผ ์ „์†ก -> ์„œ๋ฒ„์— ํŒŒ์ผ ์œ„์น˜ ์ €์žฅ( ์ฝ”๋”ฉ - ๊ฐœ๋ฐœ์ž ์ง์ ‘ )  + ํŒŒ์ผ์—…๋กœ๋“œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ


autocomplete="on"   ์‚ฌ์šฉ์ž ์ด์ „์— ์ž…๋ ฅํ•œ ๊ฐ’์„ ๊ธฐ๋ณธ์œผ๋กœ ์ž๋™ ์™„์„ฑ ์†์„ฑ 

<form action="ex04_ok.jsp" method="get"  autocomplete="off">
 
   <!-- 12:05 ์ˆ˜์—… ์‹œ์ž‘~! -->
   
   <!-- ๋ธŒ๋ผ์šฐ์ € ์ง€์›ํ•˜๋Š” ์ƒ‰์ƒ  -->
  <!-- ์„ ํƒํ•œ ์ƒ‰์ƒ์˜ ๋ฐฐ๊ฒฝ์ƒ‰์œผ๋กœ ์ง€์ • - ์‚ฌ์šฉ์ž ๋ฐ˜์‘ ์ฒ˜๋ฆฌ js,jquery -->
   <input type="color"  id="bgcolor"><br>
   
   ์ƒ๋…„์›”์ผ : <input type="date" id="birth"><br>
   
   <button type="button"  onclick="birth_test();">์ƒ์ผํ™•์ธ</button>
   <script>
       // var i = 1;
       function birth_test(){
    	   //  console.log( "test " + i++ );
    	   // input์ž…๋ ฅํƒœ๊ทธ๋“ค์˜ ๊ฐ’์€ value ์†์„ฑ ์ฝ/์“ฐ  ( ๊ธฐ์–ต )
    	   // js
    	   // var birth = document.getElementById("birth").value;
    	   // console.log( "์ƒ์ผ : " +  birth    );
    	   
    	   // jquery 
    	   // jquery method - val()
    	   var birth = $("#birth").val();
    	   console.log( "jquery ์ƒ์ผ : " +  birth    );
       }
   </script>
   <br>
   <input type="datetime-local"><br>
   <input type="datetime"><br>
   
   <br><br>
   ์„ค๋ฌธ(ํˆฌํ‘œ) ๊ธฐ๊ฐ„ :  <!--  ์‹œ์ž‘ ~ ์ข…๋ฃŒ -->
   <input type="date"   min="2022-11-05" max="2022-11-12">
   <br>
   <!-- ๋…„๋„์™€ ์›”๋งŒ ์„ ํƒ ๊ฐ€๋Šฅ  -->
   month : <input type="month">
   <br>
   <!-- ***** type="hidden" ์ž…๋ ฅ๊ฐ’์„ ์ˆจ๊น€-->
   
   <!-- ์„œ๋ธŒ๋ฐ‹ ๊ธฐ๋Šฅ์ด ์žˆ๋‹ค. -->
   image : <input type="image" src="../images/favicon.ico">
   <!-- <a><img></a> -->
   <br>
   
   <!-- js .์ „๊ณต์ž  -->
   <!-- on input  ์ด๋ฒคํŠธ๋Š” ์Šฌ๋ผ์ด๋” ๋ณ€๊ฒฝ(์›€์ง์ž„)ํ• ๋•Œ ๋งˆ๋‹ค ์ผ์–ด๋‚˜๋Š” ์ด๋ฒคํŠธ -->
   <!-- on change  ์ด๋ฒคํŠธ๋Š”  value ์†์„ฑ๊ฐ’์ด ๋ณ€๊ฒฝ๋  ๋•Œ ์ผ์–ด๋‚˜๋Š” ์ด๋ฒคํŠธ -->
   range : <input type="range" min="0"   max="100"  value="0" 
oninput="volumn_change(  this )">
   <input  id="volumnValue"  value="0"  
     style="text-align: center">
   <script>
       function volumn_change(  rangeobject ){
    	   document.getElementById("volumnValue").value =  rangeobject.value;
       }
   </script>  
     
   <br> 
   search : <input type="search">
   <br>
   <!-- 000-0000-0000  ์ „ํ™”๋ฒˆํ˜ธ ํ˜•์‹ -->
   tel : <input type="tel"  pattern="[0-9]{3}-\d{4}-\d{4}">
   <br>
   text : <input type="text"  pattern="[0-9]{3}-\d{4}-\d{4}">
   <br>
   <!-- ๋…„, 46๋ฒˆ์งธ ์ฃผ -->
   week : <input type="week">
   <br>
   time : <input type="time">
   <br>
   
   
   
   
   <!-- ์„œ๋ธŒ๋ฐ‹ ๊ธฐ๋Šฅ X, ์ผ๋ฐ˜ ๋ฒ„ํŠผ ์ธ๋ฐ  js, jquery ์‚ฌ์šฉํ•ด์„œ ์„œ๋ธŒ๋ฐ‹ ๊ตฌํ˜„ -->
   <input type="button"  value="์ œ์ถœ">
 
</form>
  <script>
      // jquery  ์ฝ”๋”ฉ.     
      /*
      $("input[type='button'][value='์ œ์ถœ']").click(function() {
      	alert("test-3");
      });
      */
      
      /*
      // jquery selector      :button == input[type='button'],    button
      $(":button").click(function() {    	  
    	  // ์ž…๋ ฅ๊ฐ’์— ๋Œ€ํ•œ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ๋ฅผ ํ•œ ํ›„์— .. 
    	  
      	 $("form")[0].submit();
      });
      */
  </script>
 <!-- 
 ํ˜„์žฌ ํŽ˜์ด์ง€์—๋Š” ์กด์žฌํ•˜์ง€๋งŒ ๋ณด์ด์ง€ ์•Š๋„๋ก ์ˆจ๊ธฐ๊ฒ ๋‹ค. - ์ƒํƒœ๊ด€๋ฆฌ
  -->
  
 <input type="hidden"  value="<%= age %>"  name="age">

form ์†์„ฑ ->  input  form์†์„ฑ

 

[๋ฐ–์—์žˆ๋Š” input ์•ˆ์—์„œ ์ ์šฉํ•˜๋Š”๋ฒ•]

<label for="age">๋‚˜์ด </label> 
 <!-- form="form1" ์†์„ฑ ์ถ”๊ฐ€-->
 <input type="text" id="age" name="age" value="20"  form="form1"><br>

 

[์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ์•ˆํ•˜๊ณ  submit]

<form action="ex05_01.jsp"  id="form2"  novalidate="novalidate">
     <label for="name">์ด๋ฆ„ </label> <input type="text" id="name" name="name"  autofocus="autofocus" value="ํ™๊ธธ๋™"  required="required"><br>
     <label for="age">๋‚˜์ด </label>  <input type="text" id="age" name="age" value="20"><br> 
     <input type="submit" formtarget="_blank"  formnovalidate="formnovalidate">
</form>

- ๋ชจ๋“  ์ž…๋ ฅ ํƒœ๊ทธ์˜ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ๋ฌดํšจํ™” novalidate="novalidate"

- formnovalidate="formnovalidate" ์„œ๋ธŒ๋ฐ‹ ๋  ๋•Œ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ X

 

[action ๋‹ค๋ฅธํŽ˜์ด์ง€๋กœ ๋„˜๊ฒจ์ฃผ๋Š”๋ฒ• form]

<form action="ex05_01.jsp"  id="form1" method="post" >
     <label for="name">์ด๋ฆ„ </label> <input type="text" id="name" name="name"  autofocus="autofocus" value="ํ™๊ธธ๋™"><br>
     <input type="submit"  formmethod="get">
     <!-- formaction="ex05_02.jsp"์†์„ฑ -->
     <input type="submit"  formaction="ex05_02.jsp"  formenctype="multipart/form-data"> 
     <br>
     ์ฒจ๋ถ€ํŒŒ์ผ  <Input type="file">
</form>

- enctype="multipart/form-data"


<input list="deptlist">
<datalist  id="deptlist">
   <option value="ACCOUNTING"></option>
   <option value="RESEARCH"></option>
   <option value="SALES"></option>
   <option value="OPERATIONS"></option>
</datalist>

๊ทธ๋ž˜ํ”ฝ :  canvas(์ฒœ), svg ํƒœ๊ทธ

 

canvas ํƒœ๊ทธ๋Š”

  - ์›น ํŽ˜์ด์ง€์— ๊ทธ๋ž˜ํ”ฝ์„ ๊ทธ๋ฆฌ๋Š” ๋ฐ ์‚ฌ์šฉ๋˜๋Š” ํƒœ๊ทธ

  - [js๋ฅผ ์‚ฌ์šฉ]ํ•ด์„œ ๊ทธ๋ž˜ํ”ฝ์„ ๊ทธ๋ฆฌ๋Š” ๋ฐ ์‚ฌ์šฉ๋˜๋Š” ์ปจํ…Œ์ด๋„ˆ ์—ญํ• 

  - ์›, ํ…์ŠคํŠธ, ์ด๋ฏธ์ง€ ๋“ฑ๋“ฑ

  - id ์†์„ฑ์€ ํ•„์ˆ˜

  - width, height ์†์„ฑ  ํฌ๊ธฐ ์ง€์ •. 

 

ex_1)

<canvas id="myCanvas" width="200" height="100"  style="border:1px solid #000"></canvas>
<script>
   // 1. ์บ”๋ฒ„์Šค ์š”์†Œ๋ฅผ ์–ป์–ด์™€์•ผ ๋œ๋‹ค.
   var c = document.getElementById("myCanvas");
   var ctx =  c.getContext("2d");
   
   // ์„ 
   ctx.moveTo(0, 0);
   ctx.lineTo(200, 100);
   ctx.stroke(); // ํƒ€๊ฒฉ, ๋•Œ๋ฆฌ๊ธฐ
   
   // ์›
   ctx.beginPath();
   ctx.arc( 95,50, 40, 0, 2 * Math.PI);
   ctx.stroke();
   // ํ…์ŠคํŠธ
   ctx.font =   "30px Arial";
   ctx.strokeText("Hello Word",10, 50); 
</script>

ex_2)

<img  id="scream" alt="scream" src="../images/img_the_scream.jpg">

<p><button onclick="scream_drawing();">์บ”๋ฒ„์Šค</button></p>

<canvas id="myCanvas" width="240" height="300"  style="border:1px solid #000"></canvas>

<script>
   function scream_drawing(){
	   var c = document.getElementById("myCanvas");
	   var ctx =  c.getContext("2d");
	   
	   var screamimage =  document.getElementById("scream");
	   ctx.drawImage(screamimage, 10, 10);
   }
</script>

 

   [ svg ]

   - SVG  ๊ทธ๋ž˜ํ”ฝ์„ ์œ„ํ•œ ์ปจํ…Œ์ด๋„ˆ

   - SVG ๋Š” XML ํ˜•์‹์˜  ๋ฒกํ„ฐ ๊ธฐ๋ฐ˜ ๊ทธ๋ž˜ํ”ฝ ์ •์˜

   - ๋ฒกํ„ฐ ๊ธฐ๋ฐ˜ ? ํ™•์žฅ ๊ฐ€๋Šฅํ•œ ๊ทธ๋ž˜ํ”ฝ 

<svg style="width: 100px;height:100px">
   <circle  cx="50" cy="50"   r="40"  stroke="green" stroke-width="4" fill="yellow" />
</svg>

<svg style="width: 400px;height:100px">
   <rect width="400" height="100" 
   style="stroke:rgb(0,0,0);stroke-width:10;fill:rgb(0,0,255);" />
</svg>

 <br>
 <svg width="300" height="200">
  <polygon points="100,10 40,198 190,78 10,78 160,198"
  style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;" />
  </svg>
  
   <br>
<svg height="130" width="500">
  <defs>
    <linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%">
      <stop offset="0%" style="stop-color:rgb(255,255,0);stop-opacity:1" />
      <stop offset="100%" style="stop-color:rgb(255,0,0);stop-opacity:1" />
    </linearGradient>
  </defs>
  <ellipse cx="100" cy="70" rx="85" ry="55" fill="url(#grad1)" />
  <text fill="#ffffff" font-size="45" font-family="Verdana" x="50" y="86">SVG</text>
  Sorry, your browser does not support inline SVG.
</svg>

 

svg์™€ canvas ์ฐจ์ด์ 

- svg       :  xml + 2d ๊ทธ๋ž˜ํ”ฝ ์–ธ์–ด

- canvas :  js     + 2d      " 


๋ฉ€ํ‹ฐ๋ฏธ๋””์–ด

    1. ์›น ์ƒ์—์„œ ๋ฉ€ํ‹ฐ๋ฏธ๋””์–ด๋Š” ์‚ฌ์šด๋“œ, ์Œ์•…, ๋น„๋””์˜ค, ์˜ํ™” ๋ฐ ์• ๋‹ˆ๋ฉ”์ด์…˜.

     2. ์ผ๋ฐ˜์ ์ธ ๋น„๋””์˜ค ํ˜•์‹ :  .mpg,  .mpeg, .avi, .wmv, .mov, .swf, .webm. .mp4 ๋“ฑ๋“ฑ

       (    html ํ‘œ์ค€ :   mp4. ogg. webm ๋งŒ ์ง€์›ํ•œ๋‹ค....   )

            YouTube ์—์„œ๋Š” mp4 ํ˜•์‹์„ ๊ถŒ์žฅํ•œ๋‹ค. 

     3. ์ผ๋ฐ˜์ ์ธ ์˜ค๋””์˜ค ํ˜•์‹ : .wav, .ogg, .mp3, .wma ๋“ฑ๋“ฑ

      (    html ํ‘œ์ค€ :   mp3, .ogg, .wav  ๋งŒ ์ง€์›ํ•œ๋‹ค....   )

 

 

๋น„๋””์˜ค

1.  html ํƒœ๊ทธ     <video>  ํƒœ๊ทธ๋ฅผ ์‚ฌ์šฉ. - ์›น ํŽ˜์ด์ง€์— ๋น„๋””์˜ค๋ฅผ ํ‘œ์‹œ.

2. width, height ์†์„ฑ์„ ํ•˜์ง€ ์•Š์œผ๋ฉด ๋™์˜์ƒ์ด ๋กœ๋“œ ๋˜๋Š” ๋™์•ˆ ํŽ˜์ด์ง€๊ฐ€ ๊นœ๋นก์ผ ์ˆ˜ ์žˆ๋‹ค. 

3.  controls ์†์„ฑ ์ถ”๊ฐ€ ( ์žฌ์ƒ, ์ผ์‹œ์ •์ง€, ๋ณผ๋ฅจ, ๋“ฑ๋“ฑ ๋น„๋””์˜ค ์ปจํŠธ๋กค ํ•˜๋Š” ์†์„ฑ)

 

<video src="movie.mp4"  width="320" height="240" controls="controls"></video>

<video  width="320" height="240" autoplay="autoplay" muted="muted">
  <source src="movie.mp4"  type="video/mp4">
  <source src="movie.ogg"  type="video/ogg">
  ํ˜„์žฌ ๋ธŒ๋ผ์šฐ์ €๋Š” ์ง€์›ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
</video>

- control : 

- source ์ž์‹ ํƒœ๊ทธ : ๋ธŒ๋ผ์šฐ์ € ์„ ํƒ

- autoplay ์ž๋™์‹คํ–‰,  muted ์กฐ์šฉํ•œ, ๋‚ฎ์€ == ๋ฌต์Œ

 

 ์˜ค๋””์˜ค

 <audio controls autoplay  muted="muted">
    <source src="horse.mp4"  type="audio/mpeg">
    <source src="horse.ogg"  type="audio/ogg">
    ํ˜„์žฌ ๋ธŒ๋ผ์šฐ์ €๋Š” ์ง€์›ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. 
 </audio>

- ์ฐธ๊ณ : ํฌ๋กฌ ๋ธŒ๋ผ์šฐ์ €๋Š” ๋Œ€๋ถ€๋ถ„์˜ ๊ฒฝ์šฐ ์ž๋™ ์žฌ์ƒ์„ ํ—ˆ์šฉํ•˜์ง€ ์•Š๋Š”๋‹ค.
                 ( ์Œ ์†Œ๊ฑฐ + ์ž๋™์žฌ์ƒ ๊ฐ€๋Šฅ ) 


ํ”Œ๋Ÿฌ๊ทธ์ธ :  ๋ธŒ๋ผ์šฐ์ €์˜ ํ‘œ์ค€ ๊ธฐ๋Šฅ์„ ํ™•์žฅํ•˜๋Š” ์ปดํ“จํ„ฐ ํ”„๋กœ๊ทธ๋žจ

 - JAVA ์• ํ”Œ๋ฆฟ ์‹คํ–‰  ( ๋Œ€๋ถ€๋ถ„ ๋ธŒ๋ผ์šฐ์ € ์ง€์› X )

 - MS  ActiveX ์‹คํ–‰ ( X )

 - Flash ์‹คํ–‰ ( X )

 - ์ง€๋„ ์‹คํ–‰

 ๋“ฑ๋“ฑ

 

1. ๋ชจ๋“  ๋ธŒ๋ผ์šฐ์ € ์ง€์›

2. ์• ํ”Œ๋ฆฟ, ActiveX, Flash ๋“ฑ๋“ฑ ํ”Œ๋Ÿฌ๊ทธ์ธ .. X -> html ๋ฌธ์„œ๋ฅผ ํฌํ•จํ•˜๋Š” ๋ฐ ์‚ฌ์šฉํ•  ์ˆ˜ ๋„ ์žˆ๋‹ค. 

<object width=""  height="" data="sample.html"></object>
<object data="audi.jpeg"></object>

<embed width=""  height="" src="sample.html">
<embed src="audi.jpeg"><!--  ์ข…๋ฃŒ ํƒœ๊ทธ X , html5 X-->

YouTube ๋™์˜์ƒ

1. html๋กœ ๋™์˜์ƒ์„ ์žฌ์ƒํ•˜๋Š” ๊ฐ€์žฅ ์‰ฌ์šด ๋ฐฉ๋ฒ•? YouTube ๋™์˜์ƒ 

2. YouTube ๋™์˜์ƒ ID

     ์˜ˆ) https://www.youtube.com/watch?v=    [       IrceIe4x1PI    ]

     [       IrceIe4x1PI    ] == YouTube ๋™์˜์ƒ ID

     ์ด YouTube ๋™์˜์ƒ ID ๋ฅผ ์ด์šฉํ•ด์„œ html ์—์„œ ๋™์˜์ƒ์„ ์žฌ์ƒํ•  ์ˆ˜ ์žˆ๋‹ค.

3. ์›น ์‚ฌ์ดํŠธ์—์„œ ํ•„์š”ํ•œ ๋™์˜์ƒ -> YouTube ๋™์˜์ƒ ์—…๋กœ๋“œ

4. YouTube ๋™์˜์ƒ ID  ๊ธฐ๋ก

5. iframe ํƒœ๊ทธ 

<iframe width="420" height="315" src="https://www.youtube.com/embed/tgbNymZ7vqY"></iframe>

<!-- ์ž๋™ ์žฌ์ƒ + ์Œ์†Œ๊ฑฐ -->
<iframe width="420" height="315" src="https://www.youtube.com/embed/tgbNymZ7vqY?autoplay=1&mute=1"></iframe>

<!-- ์ปจํŠธ๋กค๋Ÿฌ ํ‘œ์‹œ( X )   controls=0,  1(๊ธฐ๋ณธ๊ฐ’) -->
<iframe width="420" height="315" src="https://www.youtube.com/embed/tgbNymZ7vqY?controls=0"></iframe>

<!-- 
loop=0  ๋น„๋””์˜ค๊ฐ€ 1๋ฒˆ ์žฌ์ƒ
loop=1   ๋น„๋””์˜ค ๋ฌดํ•œ ๋ฐ˜๋ณต ์žฌ์ƒ
 -->
<iframe width="420" height="315" src="https://www.youtube.com/embed/tgbNymZ7vqY?loop=1"></iframe>

[ html API ] + js

1. ์ง€๋ฆฌ์  ์œ„์น˜

2. ๋“œ๋ž˜๊ทธ / ๋“œ๋กญ

3. ์›น ์Šคํ† ์ง€( ์ €์žฅ์†Œ )  

4. ์›น ์ž‘์—…์ž

5. SSE

  • ๋„ค์ด๋ฒ„ ๋ธ”๋Ÿฌ๊ทธ ๊ณต์œ ํ•˜๊ธฐ
  • ๋„ค์ด๋ฒ„ ๋ฐด๋“œ์— ๊ณต์œ ํ•˜๊ธฐ
  • ํŽ˜์ด์Šค๋ถ ๊ณต์œ ํ•˜๊ธฐ
  • ์นด์นด์˜ค์Šคํ† ๋ฆฌ ๊ณต์œ ํ•˜๊ธฐ