2017-05-10 19 views
1

MPEG-CENC로 보호 된 MPEG-DASH 비디오를 재생하기위한 테스트 HTML 페이지를 만들었으며 player.configure()에서 kid : key pair를 지정하면 재생할 수 있습니다.shaka 플레이어에 대한 클리어 키 서버가 작동하지 않습니까?

그런 다음 클리어 키 서버를 설치하고 싶습니다. Shaka Player 문서의 DRM Configuration 섹션을 참조하십시오. 코드를 변경하여 아래처럼 라이센스를 얻을 수있는 URL을 지정했습니다. 그러나 Visual Studio에서 Page_Load 이벤트에 중단 점을 설정하면 페이지가 표시되지 않습니다. 브라우저의 콘솔에 오류가 없습니다.

내가 사용하는 브라우저는 Firefox 53.0.2 및 Chrome 58.0.3029.96입니다. 내가 뭐 놓친 거 없니? 여기

<!DOCTYPE html> 
<html> 
<head> 
    <meta charset="utf-8" /> 
    <script src="https://cdnjs.cloudflare.com/ajax/libs/shaka-player/2.1.0/shaka-player.compiled.js"></script> 
    <title>MPEG-DASH Player Test</title> 
    <script> 
     //MPEG-DASH stream encrypted with MPEG-CENC: 
     var manifestUri = '/dashtest_encrypted/stream.mpd'; 

     function initApp() { 
      // Install built-in polyfills to patch browser incompatibilities. 
      shaka.polyfill.installAll(); 

      // Check to see if the browser supports the basic APIs Shaka needs. 
      if (shaka.Player.isBrowserSupported()) { 
       // Everything looks good! 
       initPlayer(); 
      } else { 
       // This browser does not have the minimum set of APIs we need. 
       console.error('Browser not supported!'); 
      } 
     } 

     function initPlayer() { 
      // Create a Player instance. 
      var video = document.getElementById('video'); 
      var player = new shaka.Player(video); 

      // Configue 
      player.configure({ 
       drm: { 
        servers: { 
         'org.w3.clearkey': '/clearkey/GetLic.aspx' 
        }, 
        clearKeys: { 
         //'kid': 'key' 
        } 
       } 
      }); 

      // Attach player to the window to make it easy to access in the JS console. 
      window.player = player; 

      // Listen for error events. 
      player.addEventListener('error', onErrorEvent); 

      // Try to load a manifest. 
      // This is an asynchronous process. 
      player.load(manifestUri).then(function() { 
       // This runs if the asynchronous load is successful. 
       console.log('The video has now been loaded!'); 
      }).catch(onError); // onError is executed if the asynchronous load fails. 
     } 

     function onErrorEvent(event) { 
      // Extract the shaka.util.Error object from the event. 
      onError(event.detail); 
     } 

     function onError(error) { 
      // Log the error. 
      console.error('Error code', error.code, 'object', error); 

      alert(error.code); 
     } 

     document.addEventListener('DOMContentLoaded', initApp); 
    </script> 
</head> 
<body> 
    <video id="video" autoplay controls></video> 
</body> 
</html> 

이 stream.MPD의 내용이다 : 아주 긴 시간 테스트 및 비교 후

<?xml version="1.0" ?> 
<MPD mediaPresentationDuration="PT12M3.022S" minBufferTime="PT15.48S" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="static" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:cenc="urn:mpeg:cenc:2013"> 
    <!-- Created with Bento4 mp4-dash.py, VERSION=1.7.0-614 --> 
    <Period> 
    <!-- Video --> 
    <AdaptationSet maxHeight="720" maxWidth="1280" mimeType="video/mp4" minHeight="720" minWidth="1280" segmentAlignment="true" startWithSAP="1"> 
     <!-- MPEG Common Encryption --> 
     <ContentProtection cenc:default_KID="7a4e12f1-8610-291f-386c-7ac1b9425abf" schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc"/> 
     <SegmentTemplate duration="15482" initialization="$RepresentationID$/init.mp4" media="$RepresentationID$/seg-$Number$.m4s" startNumber="1" timescale="1000"/> 
     <Representation bandwidth="1901600" codecs="avc1.64001F" frameRate="30000/1001" height="720" id="video/avc1" scanType="progressive" width="1280"/> 
    </AdaptationSet> 
    <!-- Audio --> 
    <AdaptationSet mimeType="audio/mp4" segmentAlignment="true" startWithSAP="1"> 
     <!-- MPEG Common Encryption --> 
     <ContentProtection cenc:default_KID="7a4e12f1-8610-291f-386c-7ac1b9425abf" schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc"/> 
     <SegmentTemplate duration="15482" initialization="$RepresentationID$/init.mp4" media="$RepresentationID$/seg-$Number$.m4s" startNumber="1" timescale="1000"/> 
     <Representation audioSamplingRate="44100" bandwidth="200442" codecs="mp4a.40.2" id="audio/und/mp4a"> 
     <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/> 
     </Representation> 
    </AdaptationSet> 
    </Period> 
</MPD> 
+0

Page_Load 이벤트는 ASP 개념 - 당신은 브라우저 디버거를 사용하는 경우 직접 브레이크 포인트를 얻을 볼 수있는 이 일어나고있다. 매니페스트 파일도 표시 할 수 있습니까? 재생 문제가있을 수 있습니다. – Mick

+0

@Mick : ASP.net을 사용하여 서버 쪽 기능을 구현했습니다. 이 경우 라이센스 발급입니다. 매니페스트 파일 (stream.mpd)의 내용을 질문에 추가했습니다. – Vinix

+0

매니페스트는 괜찮아 보입니다. Shaka 플레이어는 CENC 만 지정 했으므로 아는 핵심 시스템을 사용해야합니다. 브라우저 디버거 도구를 사용하여 코드를 단계별로 실행하는 것이 차선책 일 것이라고 생각할 것입니다. 확실한 답이없는 경우 여기에서 찾은 것을 게시 할 수 있습니다. BTW, 라이선스 서버에서 명확한 핵심 서비스를 사용하는 사례가 많지 않은 이유는 최소한의 추가 보안 만 제공하기 때문입니다. – Mick

답변

1

, 내 .MPD 파일 cenc을 가지고 있지 않은 것으로 나타났습니다 : pssh 태그를, 이 문제가 발생했습니다. 나는 .mpd를 재창조했고 Shaka Player는 마침내 서버에 물었다.

은 수정 된 .MPD은 다음과 같습니다 : 나는 여기에 적용됩니다 모르겠어요 그래서

<?xml version="1.0" ?> 
<MPD mediaPresentationDuration="PT12M3.022S" minBufferTime="PT15.48S" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="static" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:cenc="urn:mpeg:cenc:2013"> 
    <!-- Created with Bento4 mp4-dash.py, VERSION=1.7.0-614 --> 
    <Period> 
    <!-- Video --> 
    <AdaptationSet maxHeight="720" maxWidth="1280" mimeType="video/mp4" minHeight="720" minWidth="1280" segmentAlignment="true" startWithSAP="1"> 
     <!-- EME Common Encryption --> 
     <ContentProtection schemeIdUri="urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b" value="cenc"> 
     <cenc:pssh>AAAANHBzc2gBAAAAEHfv7MCyTQKs4zweUuL7SwAAAAF6ThLxhhApHzhsesG5Qlq/AAAAAA==</cenc:pssh> 
     </ContentProtection> 
     <!-- MPEG Common Encryption --> 
     <ContentProtection cenc:default_KID="7a4e12f1-8610-291f-386c-7ac1b9425abf" schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc"/> 
     <SegmentTemplate duration="15482" initialization="$RepresentationID$/init.mp4" media="$RepresentationID$/seg-$Number$.m4s" startNumber="1" timescale="1000"/> 
     <Representation bandwidth="1901627" codecs="avc1.64001F" frameRate="30000/1001" height="720" id="video/avc1" scanType="progressive" width="1280"/> 
    </AdaptationSet> 
    <!-- Audio --> 
    <AdaptationSet mimeType="audio/mp4" segmentAlignment="true" startWithSAP="1"> 
     <!-- EME Common Encryption --> 
     <ContentProtection schemeIdUri="urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b" value="cenc"> 
     <cenc:pssh>AAAANHBzc2gBAAAAEHfv7MCyTQKs4zweUuL7SwAAAAF6ThLxhhApHzhsesG5Qlq/AAAAAA==</cenc:pssh> 
     </ContentProtection> 
     <!-- MPEG Common Encryption --> 
     <ContentProtection cenc:default_KID="7a4e12f1-8610-291f-386c-7ac1b9425abf" schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc"/> 
     <SegmentTemplate duration="15482" initialization="$RepresentationID$/init.mp4" media="$RepresentationID$/seg-$Number$.m4s" startNumber="1" timescale="1000"/> 
     <Representation audioSamplingRate="44100" bandwidth="200442" codecs="mp4a.40.2" id="audio/und/mp4a"> 
     <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/> 
     </Representation> 
    </AdaptationSet> 
    </Period> 
</MPD>