m3u8링크를 볼수있는 동영상 hls 게시판 스킨 > 그누보드5 스킨

그누보드5 스킨

좋은 댓글과 좋아요는 제작자에게 큰힘이 됩니다.

m3u8링크를 볼수있는 동영상 hls 게시판 스킨 정보

게시판 m3u8링크를 볼수있는 동영상 hls 게시판 스킨

첨부파일

hls.zip (28.7K) 18회 다운로드 2023-03-26 13:17:26 포인트 차감10
hls.js (1.1M) 2회 다운로드 2023-03-26 13:17:26 포인트 차감10
테스트한 버전5.4
호환 가능 버전5.3 이상

본문

간단하게 만들어 보았습니다.

기존에 vimeo 플레이어게시판을 hls로 변형하였습니다.

 

wr_link1 에 sample 링크 

 

 

 

view.skin.php

 


<script src='https://d33wubrfki0l68.cloudfront.net/js/9012aa6cdcc02be8d7cbd62c6f12aff976c2d83b/dist/hls.js'></script>

 


<script>
      var video = document.getElementById('video');      
      if (Hls.isSupported()) {
        var hls = new Hls({
          debug: true,
        });
        hls.loadSource("<?php echo $view['wr_link1'];?>");
        hls.attachMedia(video);
        hls.on(Hls.Events.MEDIA_ATTACHED, function () {
          video.muted = true;
          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 through 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 = "<?php echo $view['wr_link1'];?>";
        video.addEventListener('canplay', function () {
          video.play();
        });
      }
    </script>

 


영상위치
<video id="video" width='100%' height='auto' ></video>
추천
5
  • 복사

댓글 전체

© SIRSOFT
현재 페이지 제일 처음으로