diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/mediakeysession/index.html | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/api/mediakeysession/index.html')
-rw-r--r-- | files/zh-cn/web/api/mediakeysession/index.html | 161 |
1 files changed, 161 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/mediakeysession/index.html b/files/zh-cn/web/api/mediakeysession/index.html new file mode 100644 index 0000000000..2896b7eb8b --- /dev/null +++ b/files/zh-cn/web/api/mediakeysession/index.html @@ -0,0 +1,161 @@ +--- +title: MediaKeySession +slug: Web/API/MediaKeySession +tags: + - API + - Audio + - EncryptedMediaExtensions + - Interface + - Media + - MediaKeySession + - NeedsExample + - NeedsTranslation + - Reference + - TopicStub + - Video +translation_of: Web/API/MediaKeySession +--- +<p>{{APIRef("EncryptedMediaExtensions")}}{{SeeCompatTable}}</p> + +<p>The <code><strong>MediaKeySession</strong></code> interface of the <a href="/en-US/docs/Web/API/EncryptedMediaExtensions_API">EncryptedMediaExtensions API</a> represents a context for message exchange with a content decryption module (CDM).</p> + +<h2 id="Properties">Properties</h2> + +<dl> + <dt>{{domxref("MediaKeySession.closed")}} {{readonlyInline}}</dt> + <dd>Returns a {{jsxref("Promise")}} signaling when a <code>MediaKeySession</code> closes. This promise can only be fulfilled and is never rejected. Closing a session means that licenses and keys associated with it are no longer valid for decrypting media data. </dd> + <dt>{{domxref("MediaKeySession.expiration")}} {{readonlyInline}}</dt> + <dd>The time after which the keys in the current session can no longer be used to decrypt media data, or <code>NaN</code> if no such time exists. This value is determined by the CDM and measured in milliseconds since January 1, 1970, UTC. This value may change during a session lifetime, such as when an action triggers the start of a window.</dd> + <dt>{{domxref("MediaKeySession.keyStatuses")}} {{readonlyInline}}</dt> + <dd>Contains a reference to a read-only {{domxref("MediaKeyStatusMap")}} of the current session's keys and their statuses.</dd> + <dt>{{domxref("MediaKeySession.sessionId")}} {{readonlyInline}}</dt> + <dd>Contains a unique string generated by the CDM for the current media object and its associated keys or licenses.</dd> +</dl> + +<h3 id="Event_handlers">Event handlers</h3> + +<dl> + <dt>{{domxref("MediaKeySession.onkeystatuseschange")}}</dt> + <dd>Sets the {{domxref('EventHandler')}} called when there has been a change in the keys in a session or their statuses.</dd> + <dt>{{domxref("MediaKeySession.onmessage")}}</dt> + <dd>Sets the {{domxref('EventHandler')}} called when the content decryption module has generated a message for the session.</dd> +</dl> + +<h2 id="Methods">Methods</h2> + +<dl> + <dt>{{domxref("MediaKeySession.close()")}}</dt> + <dd> + <p class="p1">Returns a {{jsxref("Promise")}} after notifying the current media session is no longer needed and that the CDM should release any resources associated with this object and close it.</p> + </dd> + <dt>{{domxref("MediaKeySession.generateRequest()")}}</dt> + <dd>Returns a {{jsxref("Promise")}} after generating a media request based on initialization data.</dd> + <dt>{{domxref("MediaKeySession.load()")}}</dt> + <dd>Returns a {{jsxref("Promise")}} that resolves to a boolean value after loading data for a specified session object. </dd> + <dt>{{domxref("MediaKeySession.remove()")}}</dt> + <dd>Returns a {{jsxref("Promise")}} after removing any session data associated with the current object.</dd> + <dt>{{domxref("MediaKeySession.update()")}}</dt> + <dd>Returns a {{jsxref("Promise")}} after loading messages and licenses to the CDM.</dd> +</dl> + +<h2 id="Examples">Examples</h2> + +<pre class="brush: js">// TBD</pre> + +<h2 id="Specifications">Specifications</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('EME', '#mediakeysession-interface', 'MediaKeySession')}}</td> + <td>{{Spec2('EME')}}</td> + <td>Initial definition.</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility">Browser compatibility</h2> + +<div>{{CompatibilityTable}}</div> + +<div id="compat-desktop"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Chrome</th> + <th>Edge</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Opera</th> + <th>Safari (WebKit)</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{CompatChrome(42.0)}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatUnknown}}</td> + </tr> + <tr> + <td><code>onkeystatuseschange</code> and <code>onmessage</code></td> + <td>{{CompatChrome(55.0)}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatOpera(42)}}</td> + <td>{{CompatUnknown}}</td> + </tr> + </tbody> +</table> +</div> + +<div id="compat-mobile"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Android</th> + <th>Android Webview</th> + <th>Edge</th> + <th>Firefox Mobile (Gecko)</th> + <th>Firefox OS</th> + <th>IE Mobile</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + <th>Chrome for Android</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{CompatNo}}</td> + <td>{{CompatChrome(43.0)}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatChrome(42.0)}}</td> + </tr> + <tr> + <td><code>onkeystatuseschange</code> and <code>onmessage</code></td> + <td>{{CompatNo}}</td> + <td>{{CompatChrome(55.0)}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatOperaMobile(42)}}</td> + <td>{{CompatUnknown}}</td> + <td>{{CompatChrome(55.0)}}</td> + </tr> + </tbody> +</table> +</div> |