Introduction
Installation
Guides
- Engine
- Profile
- Browser
- BrowserView
- Navigation
- Content
- DOM
- JavaScript
- Pop-ups
- Dialogs
- Downloads
- Network
- Cache
- Cookies
- Proxy
- Authentication
- Plugins
- Printing
- Passwords
- User Data Profiles
- Credit Cards
- Media
- Zoom
- Spell Checker
- Deployment
- Chromium
Troubleshooting
Migration
In this migration guide we describe the API changes between 7.33.2 and 7.34
Screen Casting
In JxBrowser 7.34, if you want to start screen casting from code, you will need to set the screen in
the ScreenCastOptions.newBuilder(Screen)
:
7.33.2 and earlier:
Screen screen = profile.mediaCasting().screens().defaultScreen();
ScreenCastOptions options = ScreenCastOptions.newBuilder()
.screen(screen)
.withAudio()
.build();
CompletableFuture<CastSession> future = browser.castScreen(receiver, options);
val screen = profile.mediaCasting().screens().defaultScreen()
val options = ScreenCastOptions.newBuilder()
.screen(screen)
.withAudio()
.build()
val future: CompletableFuture<CastSession> = browser.castScreen(receiver, options)
7.34:
Screen screen = profile.mediaCasting().screens().defaultScreen();
ScreenCastOptions options = ScreenCastOptions.newBuilder(screen)
.withAudio()
.build();
CompletableFuture<CastSession> future = browser.castScreen(receiver, options);
val screen = profile.mediaCasting().screens().defaultScreen()
val options = ScreenCastOptions.newBuilder(screen)
.withAudio()
.build()
val future: CompletableFuture<CastSession> = browser.castScreen(receiver, options)
Supporting Media Sources
In JxBrowser 7.34, the MediaReceiver.supports(CastMode)
method has been removed. Instead, you should use
MediaReceiver.supports(MediaSource)
:
7.33.2 and earlier:
To check if a receiver supports casting any browser’s content:
MediaReceiver receiver = mediaReceivers.await(it -> it.name().contains("Samsung"));
if (receiver.supports(CastMode.BROWSER)) {
// Logic
}
val receiver = mediaReceivers.await { it.name().contains("Samsung") }
if (receiver.supports(CastMode.BROWSER)) {
// Logic
}
To check if a receiver supports casting any screen’s content:
MediaReceiver receiver = mediaReceivers.await(it -> it.name().contains("Samsung"));
if (receiver.supports(CastMode.SCREEN)) {
// Logic
}
val receiver = mediaReceivers.await { it.name().contains("Samsung") }
if (receiver.supports(CastMode.SCREEN)) {
// Logic
}
To check if a receiver supports presentation:
MediaReceiver receiver = mediaReceivers.await(it -> it.name().contains("Samsung"));
if (receiver.supports(CastMode.PRESENTATION)) {
// Logic
}
val receiver = mediaReceivers.await { it.name().contains("Samsung") }
if (receiver.supports(CastMode.PRESENTATION)) {
// Logic
}
7.34:
To check if a receiver supports casting any browser’s content:
MediaReceiver receiver = mediaReceivers.await(it -> it.name().contains("Samsung"));
if (receiver.supports(MediaSource.browser())) {
// Logic
}
val receiver = mediaReceivers.await { it.name().contains("Samsung") }
if (receiver.supports(MediaSource.browser())) {
// Logic
}
To check if a receiver supports casting any screen’s content:
MediaReceiver receiver = mediaReceivers.await(it -> it.name().contains("Samsung"));
if (receiver.supports(MediaSource.screen())) {
// Logic
}
val receiver = mediaReceivers.await { it.name().contains("Samsung") }
if (receiver.supports(MediaSource.screen())) {
// Logic
}
To check if a receiver supports a specific PresentationRequest
as the media source:
MediaReceiver receiver = mediaReceivers.await(it -> it.name().contains("Samsung"));
browser.defaultPresentationRequest().ifPresent(presentationRequest -> {
if (receiver.supports(presentationRequest)) {
// Logic
}
});
val receiver = mediaReceivers.await { it.name().contains("Samsung") }
browser.defaultPresentationRequest().ifPresent {
if (receiver.supports(it)) {
// Logic
}
}