• 회원가입
  • 로그인
  • 구글아이디로 로그인

[js] JS - m3u8 ★ (동영상재생 + 플레이어 다운 + 동영상다운로드 : 엠삼유팔 = 엠쓰리유팔 )

목차
  1. m3u8 플레이어 다운로드
  2. m3u8 샘플주소
  3. m3u8 플레이어 (재생)
  4. m38u 다운로드 ★

 

m3u8 플레이어 다운로드 

 

https://github.com/bharadwajpro/m3u8-player

 

 

m3u8 샘플주소

 

https://bitmovin-a.akamaihd.net/content/playhouse-vr/m3u8s/105560.m3u8

 

 

m3u8 플레이어 (재생)

1. hls.js 방법 

 

  • 정상작동 :  Chrome  /  FireFox  /  Opera  /  Edge
  • 조건작동 :  IE11 : flash player가 최신버전이 아닌 경우 작동 안하기도 함.
  • 동작안함 :  iPhone  /  IE6,7,8,9,10
  • 재생특징 :  플레이어 제어수단 없음. 
  • 재생특징 :  플레이어 제어수단 없음. 풀사이즈로 자동 재생.

 

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=0,maximum-scale=10,user-scalable=yes">

<title>브라우저에서 m3u8 확장자를 가진 영상을 재생하기</title>

</head>


<body>

<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>

<video id="video"></video>

<script>

if(Hls.isSupported()) {

    var video = document.getElementById('video');

    var hls = new Hls();

    hls.loadSource('http://59.8.86.15:1935/live/52.stream/playlist.m3u8'); // 동영상경로

    hls.attachMedia(video);

    hls.on(Hls.Events.MANIFEST_PARSED,function() {

        video.play();

    });

}

// hls.js is not supported on platforms that do not have Media Source Extensions (MSE) enabled.

// When the browser has built-in HLS support (check using `canPlayType`), we can provide an HLS manifest (i.e. .m3u8 URL) directly to the video element throught the `src` property.

// This is using the built-in support of the plain video element, without using hls.js.

    else if (video.canPlayType('application/vnd.apple.mpegurl')) {

    video.src = 'http://59.8.86.15:1935/live/52.stream/playlist.m3u8'; // 동영상경로

    video.addEventListener('canplay',function() {

        video.play();

    });

}

</script>


</html>

 


2. videojs-contrib-hls.js 방법 ★

 

  • 정상작동 :  Chrome  /  FireFox  /  Opera  /  Edge  /  iPhone
  • 조건작동 : IE11 : flash player가 최신버전이 아닌 경우 작동 안하기도 함. 
  • 재생특징 :  플레이어 제어수단 없음. 풀사이즈로 자동 재생.

 

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=0,maximum-scale=10,user-scalable=yes">

<title>브라우저에서 m3u8 확장자를 가진 영상을 재생하기</title>

</head>


<body>

<link href="video-js.css" rel="stylesheet">

<script src="video.js"></script>

<script src="videojs-flash.js"></script>

<script src="videojs-contrib-hls.js"></script>

<script>

    var player = videojs('hlsPlayEx');

    player.play();

</script>


<video id="example_video_1" class="video-js vjs-default-skin" controls autoplay width="500" height="300" data-setup="{}">

    <source src="https://video-dev.github.io/streams/x36xhzz/x36xhzz.m3u8" type="application/x-mpegURL">

</video>

 

</html>

 

해피정 님 http://www.happyjung.com/lecture/2671

 

m38u 다운로드 ★

 

1.

m3u8-windows-10-x64.exe 파일을 C:\ 드라이브에 다운로드

https://github.com/oopsguy/m3u8/releases/tag/v1.0

 

2.

아래 방법 중 하나 이용해 도스창 띄우기

방법1: 시작 > 실행 > cmd 입력 > 확인
방법2: 윈도우키 + R키 > cmd 입력 > 확인
방법3: 시작 버튼 위에서 마우스오른쪽 눌러, Windows PowerShell 실행.

3.

아래 명령어 입력

다운경로/m3u8-windows-10-x64.exe -u="https://m3u8 주소.m3u8" -o="저장폴더경로"

(예) 

C:\m3u8-windows-10-x64.exe -u="http://59.8.86.15:1935/live/52.stream/playlist.m3u8" -o="C:\"

 

정보참고: https://tgd.kr/funzinnu/36431935

관련글: https://blog.naver.com/prawnion/221283676321



분류 제목
HTML_Objects JS - <option> 객체 ★ - 선택사항 (= 옵션사항 = option태그 = 옵션태그)
HTML_Objects JS - <output> 객체 - 계산결과값출력 (= 산출태그 = output태그 = 아웃풋태그) (HTML…
HTML_Objects JS - <p> 객체 - 글단락 (= p태그 = p요소 = 글문단 = 단락태그 = 문단태그 = 피태그)
HTML_Objects JS - <param> 객체 - 미디어매개변수 (= param태그 = 패럼태그 = 파람태그 = 패러미터태그 …
HTML_Objects JS - <pre> 객체 ★ - 공백줄바꿈보존 (= 보존태그 = 있는그대로태그 = 있는대로태그 = pre태그…
HTML_Objects JS - <progress> 객체 - 진행상태바 (=진행바 = 진행막대 = 작업막대 = progress태그 …
HTML_Objects JS - <q> 객체 - 짧은인용구 (= 짧은인용태그 = q태그 = 큐태그)
HTML_Objects JS - <s> 객체 - 취소선 (= 취소태그 = s태그 = 에스태그 = 스트라이크쓰루태그) (HTML5 재…
HTML_Objects JS - <samp> 객체 - 프로그램산출예제 (= 예제태그 = samp태그 = 샘프태그 = 샘플태그)
HTML_Objects JS - <script> 객체 ★ - JS코드입력 (= 동적기능언어입력 = script태그 = 스크립트태그)
HTML_Objects JS - <section> 객체 ★ - 문서단락 (= section태그 = 섹션태그, IE9)
HTML_Objects JS - <select> 객체 ★★ - 선택메뉴 (= select메뉴 = select태그 = 실렉트태그/셀렉…
HTML_Objects JS - <small> 객체 - 작은글씨 (= small태그 = 스몰태그)
HTML_Objects JS - <source> 객체 - 미디어소스 불러오기 (= source태그 = 소스태그, IE9)
HTML_Objects JS - <span> 객체 ★★★ - 인라인요소그룹 (= span태그 = 스팬태그)</span>
HTML_Objects JS - <strong> 객체 ★ - 굵은 글씨 (=폰트 굵게 = 글씨 굵게 = strong태그 = 스트롱태…
HTML_Objects JS - <style> 객체 ★ - 요소에 CSS스타일적용 (= style태그 = 스타일태그)
HTML_Objects JS - <sub> 객체 ★ - 아래첨자 (= 하단작은글씨 = 하단태그 = sub태그 = 서브태그)
HTML_Objects JS - <summary> 객체 - 세부사항의 머리글 (= summary태그 = 서머리태그 = 써머리태그)…
HTML_Objects JS - <sup> 객체 ★ - 위첨자 (= 상단작은글씨 = 상단태그 = sup태그 = 섭태그 = 서프태그 …
59/67
목록
찾아주셔서 감사합니다. Since 2012