从 7.27 到 7.28
Fullscreen API
在新版本中,Fullscreen API(全屏 API)得到了扩展并被提取到了一个专用的服务中。
专用 FullScreen
服务
v7.27
browser.on(FullScreenEntered.class, event -> {
Browser browser = event.browser();
});
browser.on(FullScreenExited.class, event -> {
Browser browser = event.browser();
});
browser.on(FullScreenEntered::class.java) { event ->
val browser: Browser = event.browser()
}
browser.on(FullScreenExited::class.java) { event ->
val browser: Browser = event.browser()
}
v7.28
FullScreen fullScreen = browser.fullScreen();
fullScreen.on(FullScreenEntered.class, event -> {
FullScreen fullScreen = event.fullScreen();
Browser browser = fullScreen.browser();
});
fullScreen.on(FullScreenExited.class, event -> {
FullScreen fullScreen = event.fullScreen();
Browser browser = fullScreen.browser();
});
val fullScreen: FullScreen = browser.fullScreen()
fullScreen.on(FullScreenEntered::class.java) { event ->
val fullScreen = event.fullScreen()
val browser = fullScreen.browser()
}
fullScreen.on(FullScreenExited::class.java) { event ->
val fullScreen: FullScreen = event.fullScreen()
val browser = fullScreen.browser()
}
退出全屏模式
在 JxBrowser 7.28 版本中,现在支持退出全屏模式了。
browser.fullScreen().exit();
browser.fullScreen().exit()