HTMLMediaElement: sự kiện encrypted

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.

Sự kiện encrypted được kích hoạt khi tìm thấy dữ liệu khởi tạo trên phương tiện cho biết nó đã được mã hóa.

Sự kiện này không thể hủy và không bong bóng.

Cú pháp

Sử dụng tên sự kiện trong các phương thức như addEventListener() hoặc đặt thuộc tính xử lý sự kiện.

js
addEventListener("encrypted", (event) => { })

onencrypted = (event) => { }

Kiểu sự kiện

Một MediaEncryptedEvent. Kế thừa từ Event.

Event MediaEncryptedEvent

Thuộc tính sự kiện

  • MediaEncryptedEvent.initDataType Read only
  • : Trả về một chuỗi phân biệt chữ hoa chữ thường với type của định dạng dữ liệu khởi tạo được tìm thấy.
  • MediaEncryptedEvent.initData Read only
  • : Trả về ArrayBuffer chứa dữ liệu khởi tạo được tìm thấy. Nếu không có dữ liệu khởi tạo liên quan đến định dạng, nó sẽ trả về null.

Đặc tả kỹ thuật

Specification
Encrypted Media Extensions
# dom-htmlmediaelement-onencrypted

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

Xem thêm