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 of the standalone window. 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 content of the standalone window. 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.
Set various properties of the standalone window.
Properties of the standalone window.
title
: the title of the window.resizable
: whether the window is resizable.hudWindow
: whether the window is a HUD window, like IINA's Inspector window.
This option will also make the window have translucency and vibrancy background effects.fullSizeContentView
: whether the window has a full size content view,
that is, the content view is not inset by the title bar.hideTitleBar
: whether the window should hide the title bar.Set the frame of the standalone window, allowing to resize and move it.
Specify null
to keep the current value.
Optional
w: numberThe width of the window.
Optional
h: numberThe height of the window.
Optional
x: numberThe x coordinate of the window.
Optional
y: numberThe y coordinate of the window.
Post a message to the standalone window.
The JS environment inside the window 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 standalone window.
The JS environment inside the window 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
StandaloneWindow
module provides a way to create a separate window to display custom content. You are able to control a full-sized webview inside the window, therefore you can use HTML, CSS, and advanced techniques like WebGL to render the contents.Two modes are provided to load the window contents:
When activating either mode, the previous mode will be deactivated and the overlay will be cleared.
The window's webview 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 and Global. Each entry can only create one standalone window, and their content and controls are isolated.