Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cefsharp WidevineCdm & CdmSupportTest.html -> Run #6

Open
mohamedosama914 opened this issue Aug 23, 2019 · 0 comments
Open

cefsharp WidevineCdm & CdmSupportTest.html -> Run #6

mohamedosama914 opened this issue Aug 23, 2019 · 0 comments
Labels
CefSharp Browser CefSharp Browser Exactly solve the problem Exactly solve the problem good first issue Good for newcomers help wanted Extra attention is needed MP4 Play not Support no supported MP4

Comments

@mohamedosama914
Copy link
Member

mohamedosama914 commented Aug 23, 2019

MP4 Play available no support & not Supported Available [MP4]

WidevineCdm is available manifest.json

{  
  "arch": "ia32",    
  "name": "WidevineCdm",
  "description": "Widevine Content Decryption Module",
  "manifest_version": 2,
  "version": "4.10.1440.18",
  "os": "win",
  "x-cdm-codecs": "vp8,vp9.0,avc1",
  "x-cdm-host-versions": "10",
  "x-cdm-interface-versions": "10",
  "x-cdm-module-versions": "4",
  "x-cdm-supported-encryption-schemes": [ "cenc", "cbcs" ],   
  "x-cdm-persistent-license-support": true

}

CdmSupportTest.html & Copy to ..\Resources\CefSharp.Web.Browser.Domain.Custom.HostName\CdmSupportTest.html

<html>
<head>
    <script language="JavaScript">
        function probeSupport() {
            var tests = [];
            var testKeySystems = [
              'com.widevine.alpha',
              'org.w3.clearkey'
            ];

            var testCodecs = [
                { type: 'H.264', contentType: 'video/mp4; codecs="avc1.42E01E"' },
                { type: 'H.264/MPEG-4 AVC', contentType: 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"' },
                { type: 'ogg', contentType: 'video/ogg; codecs="theora"' },
                { type: 'webm-vp8', contentType: 'video/webm; codecs="vp8"' },
                { type: 'webm-vp9-', contentType: 'video/webm; codecs="vp9"' }
            ];

            var basicVideoCapabilities = [
                { contentType: 'video/mp4; codecs="avc1.42E01E"' },
                { contentType: 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"' },
                { contentType: 'video/webm; codecs="vp8"' },
                { contentType: 'video/webm; codecs="vp9"' }
            ];

            var basicConfig = {
                videoCapabilities: basicVideoCapabilities
            };
            var configs = [basicConfig];
            var support = { contentDecryptionModules: {}, playbackSupport: {} };

            testKeySystems.forEach(function (keySystem) {
                var p = navigator.requestMediaKeySystemAccess(keySystem, configs)
                    .then(function (access) {
                        var config = access.getConfiguration();
                        support.contentDecryptionModules[keySystem] = "AVAILABLE";
                    }, function () {
                        support.contentDecryptionModules[keySystem] = "NOT AVAILABLE";
                    });
                tests.push(p);
            });

            return Promise.all(tests).then(function () {
                var testEl = document.createElement("video"),
            mpeg4, h264, ogg, webm;
                testCodecs.forEach(function (testCodec) {
                    var canPlay = testEl.canPlayType(testCodec.contentType);
                    canPlay = canPlay !== "" ? canPlay : "no";
                    support.playbackSupport[testCodec.type] = { "contentType": testCodec.contentType, "supported": canPlay };
                });
                return support;
            });
        }

        function printSupport(support) {
            var output = document.getElementById('output');
            output.textContent = support;
        }

        function doTest() {
            probeSupport().then(function (support) {
                printSupport(JSON.stringify(support, null, '  '));
            });
        }
    </script>
</head>
<body onload="doTest()">
<pre id="output"></pre>
    <p>
        <a href="https://shaka-player-demo.appspot.com/demo/">Google Shaka Player demo - video play back</a>
    </p>
    <p>
        <strong>Note:</strong><br />
        <ul>
            <li>
                Support for Widevine CDM requires additional steps as 
                <a href="https://github.com/cefsharp/CefSharp/issues/1934">outlined here</a>.
            </li>
            <li>
                Use of proprietary codecs (such as H.264) requires a custom build of CEF to be used due to 
                licensing requirements.<br />
                Details on how to build the CEF project and other resources can be 
                <a href="https://bitbucket.org/chromiumembedded/cef">found here</a>.</li>
        </ul>
    </p>
</body>
</html>

Run [ CdmSupportTest.html ] URL = cefsharp://cefsharp/CdmSupportTest.html


{
  "contentDecryptionModules": {
    "com.widevine.alpha": "AVAILABLE",
    "org.w3.clearkey": "AVAILABLE"
  },
  "playbackSupport": {
    "H.264": {
      "contentType": "video/mp4; codecs=\"avc1.42E01E\"",
      "supported": "no"
    },
    "H.264/MPEG-4 AVC": {
      "contentType": "video/mp4; codecs=\"avc1.42E01E, mp4a.40.2\"",
      "supported": "no"
    },
    "ogg": {
      "contentType": "video/ogg; codecs=\"theora\"",
      "supported": "probably"
    },
    "webm-vp8": {
      "contentType": "video/webm; codecs=\"vp8\"",
      "supported": "probably"
    },
    "webm-vp9-": {
      "contentType": "video/webm; codecs=\"vp9\"",
      "supported": "probably"
    }
  }
}
Google Shaka Player demo - video play back

Note:
Support for Widevine CDM requires additional steps as outlined here.
Use of proprietary codecs (such as H.264) requires a custom build of CEF to be used due to licensing requirements.
Details on how to build the CEF project and other resources can be found here.

<>

@mohamedosama914 mohamedosama914 self-assigned this Aug 23, 2019
@mohamedosama914 mohamedosama914 added the MP4 Play not Support no supported MP4 label Aug 23, 2019
@mohamedosama914 mohamedosama914 changed the title Available WidevineCdm [ CdmSupportTest.html ] | not Supported Available [ MP4 ] available WidevineCdm - CdmSupportTest.html | MP4 Play available no support Aug 23, 2019
@mohamedosama914 mohamedosama914 changed the title available WidevineCdm - CdmSupportTest.html | MP4 Play available no support WidevineCdm - CdmSupportTest.html | MP4 Play available no support Aug 23, 2019
@mohamedosama914 mohamedosama914 changed the title WidevineCdm - CdmSupportTest.html | MP4 Play available no support WidevineCdm - Run & CdmSupportTest.html | MP4 Play available no support Aug 23, 2019
@mohamedosama914 mohamedosama914 pinned this issue Aug 23, 2019
@mohamedosama914 mohamedosama914 changed the title WidevineCdm - Run & CdmSupportTest.html | MP4 Play available no support WidevineCdm - Run & CdmSupportTest.html Aug 23, 2019
@mohamedosama914 mohamedosama914 changed the title WidevineCdm - Run & CdmSupportTest.html CEF WidevineCdm - Run & CdmSupportTest.html Aug 23, 2019
@mohamedosama914 mohamedosama914 changed the title CEF WidevineCdm - Run & CdmSupportTest.html cefsharp WidevineCdm & CdmSupportTest.html -> Run Aug 23, 2019
@mohamedosama914 mohamedosama914 added good first issue Good for newcomers help wanted Extra attention is needed labels Aug 23, 2019
@mohamedosama914 mohamedosama914 removed their assignment Aug 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CefSharp Browser CefSharp Browser Exactly solve the problem Exactly solve the problem good first issue Good for newcomers help wanted Extra attention is needed MP4 Play not Support no supported MP4
Projects
None yet
Development

No branches or pull requests

1 participant