VRDisplayEvent

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.

Giao diện VRDisplayEvent của WebVR API đại diện cho đối tượng sự kiện của các sự kiện liên quan đến WebVR (xem danh sách phần mở rộng cửa sổ WebVR).

Note: Giao diện này là một phần của WebVR API cũ. Nó đã được thay thế bởi WebXR Device API.

Hàm khởi tạo

VRDisplayEvent() Deprecated Non-standard

Tạo phiên bản đối tượng VRDisplayEvent.

Thuộc tính phiên bản

VRDisplayEvent cũng kế thừa các thuộc tính từ đối tượng cha Event.

VRDisplayEvent.display Deprecated Read only Non-standard

VRDisplay liên quan đến sự kiện này.

VRDisplayEvent.reason Deprecated Read only Non-standard

Lý do con người có thể đọc được tại sao sự kiện được kích hoạt.

Ví dụ

js
window.addEventListener("vrdisplaypresentchange", (e) => {
  console.log(
    `Display ${e.display.displayId} presentation has changed. Reason given: ${e.reason}.`,
  );
});

Thông số kỹ thuật

Giao diện này là một phần của WebVR API cũ đã được thay thế bởi WebXR Device API. Nó không còn trên đường trở thành tiêu chuẩn.

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

Xem thêm