- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经创建了一个测试 html 页面来播放受 MPEG-CENC 保护的 MPEG-DASH 视频,如果我在 player.configure() 中指定 kid: key 对,我就可以播放。
然后我想设置一个 clearkey 服务器。引用DRM Configuration在 Shaka Player 文档部分,我更改了代码以指定 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>
最佳答案
经过很长时间的测试和比较,我发现我的.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>
关于drm - 为 shaka 播放器设置 clearkey 服务器不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43882946/
我已经创建了一个测试 html 页面来播放受 MPEG-CENC 保护的 MPEG-DASH 视频,如果我在 player.configure() 中指定 kid: key 对,我就可以播放。 然后我
如标题所述,PlayReady/Widevine 和 ClearKey 之间有什么区别? PlayReady/Widevine 比 ClearKey 好吗? 最佳答案 ClearKey 是针对 MPE
我有一个通过ClearKey DRM 方案 加密的.MPD 文件。我可以通过互联网连接在 Exoplayer2 中播放此文件。 Exoplayer2 正在使用LocalMediaDrmCallback
我正在尝试使用 Javascript 从 HTML5 视频元素绘制帧到 Canvas ,其中视频 (webm VP9) 已使用 clearkey 加密。我正在使用 EME 在 Chrome 中解密它。
我正在尝试播放 .MPD 文件,它正在使用 DRMSchema : clearKey 为了播放它,我按以下方式创建了一个 DefaultDrmSessionManager String keyStr
我是一名优秀的程序员,十分优秀!