File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
frontend/views/examples/capture Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 1616 <hr />
1717
1818 <div id =" output" >
19- <strong >Capture images</strong >
19+ <strong >Capture images (아래 캡쳐된 이미지를 클릭하면 다운로드 할 수 있습니다) </strong >
2020 <div id =" images" ></div >
2121 </div >
2222
Original file line number Diff line number Diff line change @@ -19,9 +19,15 @@ function capture() {
1919function insertImage ( imageData ) {
2020 const $images = document . querySelector ( '#images' ) ;
2121 const $img = document . createElement ( 'img' ) ;
22+ const $a = document . createElement ( 'a' ) ;
23+ const fileName = `[WebRTC 연구실] Capture - ${ new Date ( ) . getTime ( ) } ` ;
2224
2325 $img . src = imageData ;
24- $images . insertBefore ( $img , $images . childNodes [ 0 ] ) ;
26+ $a . href = imageData ;
27+ $a . download = fileName ;
28+ $a . appendChild ( $img ) ;
29+
30+ $images . insertBefore ( $a , $images . childNodes [ 0 ] ) ;
2531}
2632
2733/**
You can’t perform that action at this time.
0 commit comments