Indicate whether the overlay accepts input events.
If set to true
, mouse events will be passed to the overlay,
but only for the HTML elements with the data-clickable
attribute.
In this case, buttons will become clickable and input fields will become editable.
See API in Web Views for more information.
<button data-clickable>Click Me</button>
<input type="text" data-clickable>
Whether the overlay is clickable.
Clear the overlay contents and load a HTML file into the overlay.
The HTML file should contain the CSS and JavaScript code to render the contents.
It is possible to put the JavaScript code in a separate file and load it using a <script>
tag.
The webpage can communicate with the Internet using standard methods like fetch
,
but it cannot access the IINA API directly.
It should use iina.postMessage
and iina.onMessage
to exchange data with the plugin script.
See API in Web Views for more information.
The path to the HTML file, related to the plugin root directory.
(Simple Mode Only)
Set the CSS style for the overlay. The CSS string will be put into a <style>
tag at the end of <head>
.
The suggested usage is to call setStyle
once when activating the simple mode,
and then use setContent
(probably multiple times) to update the contents.
<head>
...
<style> [inserted here] </style>
</head>
An error will be raised if the overlay is not in simple mode.
The CSS string.
(Simple Mode Only)
Set the HTML contents for the overlay. The HTML string will be put into a <div>
tag inside <body>
,
with class content
.
<body>
<div class="content"> [inserted here] </div>
</body>
An error will be raised if the overlay is not in simple mode.
The HTML string.
Post a message to the overlay webview.
The overlay webview also has two methods, iina.postMessage
and iina.onMessage
, to exchange data with the plugin script.
See API in Web Views for more information.
The message name.
The message data.
Register a listener for messages posted by the overlay webview.
The overlay webview also has two methods, iina.postMessage
and iina.onMessage
, to exchange data with the plugin script.
See API in Web Views for more information.
The message name.
The callback to be called when a message with the given name is received.
The message data, posted by the JS script inside the overlay webview.
Generated using TypeDoc
The
Overlay
module provides a way to render custom contents on top of the video, which can be used to display lyrics, statistics, live comments, etc. The overlay is essentially a web view, therefore you can use HTML, CSS, and advanced techniques like WebGL to render the contents.Two modes are provided to load the overlay contents:
When activating either mode, the previous mode will be deactivated and the overlay will be cleared.
As a web view, the overlay has its own JavaScript context, which cannot access the IINA API directly. It can only communicate with the plugin script via
iina.postMessage
andiina.onMessage
to exchange data. See API in Web Views for more information.Example
Available In Entry
Main entry only