DRM 보호 기능이 있는 HTML5 비디오 플레이어를 삽입하는 방법은 무엇인가요?

Haihaisoft의 HTML5 비디오용 DRM-X 5.0은 HTML5 비디오 태그를 사용합니다. 콘텐츠 제공자는 표준 HTML5 비디오 태그를 사용하여 비디오를 쉽게 삽입할 수 있으며, VideoJS와 같은 유명한 HTML5 플레이어를 사용하고 JavaScript를 사용하여 HTML5 플레이어와 상호 작용할 수 있습니다.

더 많은 튜토리얼
DRM 보호 기능이 있는 HTML5 비디오 플레이어를 삽입하는 방법은 무엇인가요?

DRM 보호 기능이 있는 HTML5 비디오 플레이어를 삽입하는 방법은 무엇인가요?

플레이어를 크게 수정할 필요가 없다면 아래 코드를 사용하여 비디오를 삽입하세요.

<div id="ZJGet_Video_URL" style="display: none;">https://www.drm-x.com/download/drmx5/HolyForever-ChrisTomlin_P.mp4</div>
<script type="text/javascript" src="https://www.zjget.com/assets/embed_js/embed_zjget.js"></script>
<script type="text/javascript" src="https://www.zjget.com/assets/videojs-8.23.3/video.min.js"></script>
<script type="text/javascript" src="https://www.zjget.com/assets/embed_js/zjget.js"></script>

플레이어를 수정해야 하는 경우, 다음 소개를 참조하십시오.

Head 섹션에 VideoJS를 포함시키세요:

<!--Include VideoJS library-->
<link rel="stylesheet" type="text/css" href="css/video-js.css" />
<script src="js/video.js" type="text/javascript" charset="utf-8"></script>

<!--Using VideoJS skin-->
<link rel="stylesheet" type="text/css" href="css/skin/TechSkin-skin.css" />

웹사이트 스타일에 맞춰 다른 스킨을 사용할 수도 있습니다.

여기서는 VideoJS 스킨 생성 도구를 추천합니다. 이 도구를 사용하면 플레이어 스킨을 원하는 대로 맞춤 설정할 수 있습니다. https://codepen.io/heff/pen/EarCt

VideoJS 삽입:

메모: iOS의 경우, `zjget_ios_media_url`이라는 ID 값을 가진 `div`를 추가하고, 해당 `div`를 숨긴 다음, `div` 안에 비디오 URL을 입력하세요. ZJGet가 자동으로 태그를 인식하고 사용자에게 해당 비디오를 재생할지 여부를 묻는 메시지를 표시합니다. 예시:

<div id="zjget_ios_media_url" style="display: none;">https://www.drm-x.com/download/drmx5/HolyForever-ChrisTomlin_P.mp4</div>

iOS용 ZJGet 최신 버전의 미디어 URL 참고 사항:

iOS에서 동영상을 재생할 수 있도록 하려면 링크에 _P가 포함된 다음 형식을 따라야 합니다. 예를 들어, 링크는 _P.mp4, _P.webm 또는 _P.mp3와 같이 대소문자를 구분하지 않고 구성됩니다. 또는 링크에 zjget가 포함되어야 합니다. 다운로드 링크의 어느 위치에든 이러한 형식 중 하나를 포함하면 iOS용 ZJGet가 이를 인식하고 다운로드를 지원합니다.

<div id="LoadingText" style="display: none;" align="center">
  Please wait, connecting to obtain license page...
</div>
<div id="cellular_button" align="center"></div>
<div align="center">
  <script type="text/javascript">
    // Detecting current browser, if not ZJGet, It Will remind the user to open the protected files in ZJGet browser,
    // and remind the user to download ZJGet browser.
    if(navigator.userAgent.indexOf("ZJGet") == -1){
      document.write('Please open the protected files in ZJGet browser. Download ZJGet');
    }else{
      // Use HTML5 video tag;
      // ZJGet will automatically change the video tag's ID,
      // here zjget_player will automatically become zjget_player_html5_api;
      // Use src attribute specifies video URL;
      // class="video-js" using VideoJS style.
      // In data-setup, use "autoplay":true; add auto play control;
      // In data-setup, you can use "playbackRates": [0.5, 0.7, 1, 1.5, 2, 3, 4] add control speed function.;
      document.write('<'video id="zjget_player" controls="controls" class="video-js" data-setup=\' {"playbackRates": [0.5, 0.7, 1, 1.2, 1.5, 2], "autoplay":false, "width": 856, "height": 480 }\'><'source src="https://www.drm-x.com/download/drmx5/HolyForever-ChrisTomlin_P.mp4" type="video/mp4"></video>);
    }
  </script>
</div>

자바스크립트 코드:

<script type="text/javascript">
  document.onreadystatechange = function() {
    if (document.readyState == "complete") { // After the page is complete, and execute,Required;

      // Get HTML5 player
      // ZJGet will automatically change zjget_player become zjget_player_html5_api;
      myVid=document.getElementById("zjget_player_html5_api");

      // Get detail information return by the player, 

      // if user need to obtain a license, It will return a URL;

      // Otherwise, It will return the details of the protected file information and the license information.
      isSupp=myVid.canPlayType('zjget');
	// Check the mobile phone network type
      if(navigator.userAgent.indexOf("Mobile ZJGet") > 0){
		var con = window.navigator.connection;
		var network = con.type; // Mobile phone network:cellular; wifi:wifi
		// Check whether your phone is using a mobile network or wifi
		if (network == "cellular"){ // If the phone is using a mobile network, you need to add a button to get a license to the page
			document.getElementById("cellular_button").innerHTML = '<'button style="height: 50px" class="m_g_b" onClick="supportType(event,\'video/ogg\',\'theora, vorbis\')">Play Protected file (Click 2 times)'<'/button>;
		}
	  }
      // If the information contained in the return message contains URL,

      // it is required to obtain a license.
      if(isSupp.indexOf("http")>0){
        // Just a tips, non - must;
        document.getElementById("LoadingText").style.display='block';
        // Using substring to capture a URL to obtain license;
        licURL = isSupp.substring(isSupp.indexOf("http"));
        // Redirecting to obtain license page to verify and obtain license.
        window.location.href = licURL;
      }
    }
};
</script>

다음 방법은 라이선스 정보(개설 횟수 및 만료일)를 포함한 더 자세한 정보를 얻는 데 참고할 수 있는 방법을 제공합니다. 필요에 따라 이 정보를 확인할 수 있습니다.

function supportType(e,vidType,codType){
  myVid=document.getElementById("zjget_player_html5_api");
  isSupp=myVid.canPlayType("zjget");
  myVid.play();
  licURL = isSupp.substring(isSupp.indexOf("http"));

  if(isSupp.indexOf("http")>0){
    window.location.href = licURL;
  }else{
    if(isSupp.indexOf("License")>0){

      // Get open count
      var openCount=isSupp.substring(isSupp.indexOf(":"),isSupp.indexOf(";"));

      // Get the license expiration date
      var ft=isSupp.substring(isSupp.indexOf(";")+1);
      var ut = filetime_to_unixtime(ft);
      var d = new Date(ut * 1000);
      e.target.parentNode.innerHTML ="Open Count" + openCount + ", Expiration date:" + d.toLocaleString();
      return;
    }

    if(isSupp.indexOf("Error ID = 3")>0){
      e.target.parentNode.innerHTML ="License is expired, Please Re open the protected file to obtain a new license.";
      return;
    }
  }
}

기타 DRM-X 5.0 튜토리얼

DRM-X 5.0 ZJGet Windows Video TutorialDRM-X 5.0 ZJGet Windows 암호화 튜토리얼

이 비디오에서는 ZJGet 브라우저를 사용하여 Windows에서 파일을 암호화하는 방법을 보여줍니다.

지금 보기
DRM-X 5.0 ZJGet macOS Video TutorialDRM-X 5.0 ZJGet MacOS 암호화 튜토리얼

이 비디오에서는 ZJGet 브라우저를 사용하여 macOS에서의 파일을 암호화하는 방법을 보여줍니다.

지금 보기
DRM-X 5.0 ZJGet Windows TutorialDRM-X 5.0 ZJGet Windows 튜토리얼

이 비디오는 ZJGet 브라우저를 사용하여 Windows에서 암호화된 파일을 다운로드, 설치 및 여는 방법을 보여줍니다.

지금 보기
DRM-X 5.0 ZJGet Text TutorialDRM-X 5.0 ZJGet 텍스트 튜토리얼

ZJGet 브라우저 사용자 가이드. 이 튜토리얼은 ZJGet 브라우저의 핵심 기능과 실용적인 팁을 쉽게 마스터하는 데 도움을 줍니다.

지금 보기
DRM-X 5.0 ZJGet Graphic Tutorial AnswersDRM-X 5.0 ZJGet 자주 묻는 질문(FAQ)

ZJGet 브라우저 사용 관련 자주 묻는 질문(FAQ). 이 섹션에서는 가장 유용한 Q&A를 모아서 발생할 수 있는 모든 장애물을 극복하는 데 도움을 드립니다.

지금 보기
DRM-X 5.0 自动批量加密工具完整操作指南DRM-X 5.0 자동 일괄 암호화 도구 전체 사용 설명서

The DRM-X 5.0 Automated Batch Encryption Tool offers both manual and automatic scanning modes, supports multiple file formats, and enables PDF-to-HTML encryption, helping businesses efficiently and automatically implement digital rights management for batch files.

지금 보기

질문?

저희 담당자가 답변해 드립니다.

Haihaisoft 제품, 가격, 구현 또는 기타 궁금한 사항이 있으시면 언제든지 문의하세요. 숙련된 담당자들이 친절하게 도와드리겠습니다.

전화: +64 27 507 9959 (뉴질랜드)

QQ: 1279126286 / 994184623

저희에게 연락하세요 마이크로소프트 팀즈

service#haihaisoft.com (#를 @로 바꾸세요)

문의하기
contactUs