MediaKeys.createSession()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2019.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Phương thức createSession() của giao diện MediaKeys trả về một đối tượng MediaKeySession mới, đại diện cho bối cảnh để trao đổi tin nhắn với máy chủ giấy phép.

Cú pháp

js
createSession()
createSession(mediaKeySessionType)

Tham số

mediaKeySessionType Optional

Chuỗi. Một trong "temporary" (tạm thời) hoặc "persistent-license" (giấy phép liên tục). Mặc định là "temporary".

Giá trị trả về

Đối tượng MediaKeySession mới.

Thông số kỹ thuật

Thông số kỹ thuật
Encrypted Media Extensions
# dom-mediakeys-createsession

Tương thích trình duyệt