Release notes
This page provides the release notes for WebPlanetKit 5.3.
WebPlanetKit 5.3
Release date: 2024-12-23
Add the MediaStreamManager
- The
MediaStreamManager
class has been added to make it easy to create and manage aMediaStream
using media devices. - The created
MediaStreamManager
instance can easily be applied toMakeCallParams
,VerifyCallParams
,ConferenceParams
orEnableVideoOptions
for seamless interaction with WebPlanetKit.
API
Added
MediaStreamManager
class 1-to-1 callGroup callMakeCallParams
data class 1-to-1 callvar mediaStreamManager?: MediaStreamManager
VerifyCallParams
data class 1-to-1 callvar mediaStreamManager?: MediaStreamManager
ConferenceParams
data class Group callvar mediaStreamManager?: MediaStreamManager
EnableVideoOptions
data class 1-to-1 callGroup callvar mediaStreamManager?: MediaStreamManager
Example code
-
MediaStreamManager
usage example// Init MediaStreamManager
import { MediaStreamManager } from "@line/planetKit";
const mediaStreamManager = new MediaStreamManager();
// Getting default media device ID
const audioInputDevices = mediaStreamManager.getAudioInputDevices();
const defaultAudioInputDeviceId = audioInputDevices[0].deviceId;
const videoInputDevices = mediaStreamManager.getVideoInputDevices();
const defaultVideoInputDeviceId = videoInputDevices[0].deviceId;
// Create media stream with param
const mediaStreamParam = {
audioInputDeviceId: defaultAudioInputDeviceId,
videoInputDeviceId: defaultVideoInputDeviceId,
};
const mediaStream = await mediaStreamManager.createMediaStream(mediaStreamParam);
// Apply to WebPlanetKit
const conferenceParams = {
...,
mediaStreamManager: mediaStreamManager
}
planetKit.joinConference(conferenceParams);
For more APIs, see the API reference.
Add the virtual background feature
- Added the planet-kit-virtual-background plugin for the virtual background feature of WebPlanetKit. You will need to download the plugin to apply the virtual background feature to WebPlanetKit.
- The virtual background feature enables effects on the background of the video stream by detecting and segmenting the person from the background.
- This feature allows users to either blur the detected background or replace it with an image.
- The virtual background is not supported in Safari browsers.
API
Added
-
Call
class 1-to-1 callfunction registerVirtualBackground(virtualBackground: VirtualBackground)
function startVirtualBackgroundBlur(canvasElement?: HTMLCanvasElement, blurRadius?: number)
function startVirtualBackgroundImage(canvasElement: HTMLCanvasElement, image: HTMLImageElement|ImageBitmap)
function stopVirtualBackground()
function getVirtualBackgroundVideoStream(frameRate?: number)
function changeVirtualBackgroundVideoElement(videoElement: HTMLVideoElement)
function changeVirtualBackgroundCanvasElement(canvasElement: HTMLCanvasElement)
function isVirtualBackgroundActive()
-
Conference
class Group callfunction registerVirtualBackground(virtualBackground: VirtualBackground)
function startVirtualBackgroundBlur(canvasElement?: HTMLCanvasElement, blurRadius?: number)
function startVirtualBackgroundImage(canvasElement: HTMLCanvasElement, image: HTMLImageElement|ImageBitmap)
function stopVirtualBackground()
function getVirtualBackgroundVideoStream(frameRate?: number)
function changeVirtualBackgroundVideoElement(videoElement: HTMLVideoElement)
function changeVirtualBackgroundCanvasElement(canvasElement: HTMLCanvasElement)
function isVirtualBackgroundActive()
-
MediaStreamManager
class 1-to-1 callGroup callfunction registerVirtualBackground(virtualBackground: VirtualBackground)
function startVirtualBackgroundBlur(canvasElement?: HTMLCanvasElement, blurRadius?: number)
function startVirtualBackgroundImage(canvasElement: HTMLCanvasElement, image: HTMLImageElement|ImageBitmap)
function stopVirtualBackground()
function getVirtualBackgroundVideoStream(frameRate?: number)
function changeVirtualBackgroundVideoElement(videoElement: HTMLVideoElement)
function changeVirtualBackgroundCanvasElement(canvasElement: HTMLCanvasElement)
function isVirtualBackgroundActive()
How to use planet-kit-virtual-background
Example: Set up with planet-kit
// Import SDK
import { Conference } from "@line/planet-kit";
import PlanetKitVirtualBackground from "@line/planet-kit-virtual-background";
// Create a planet-kit instance (This example is for group call).
const planetKit = new Conference();
// Create a planet-kit-virtual-background instance.
const virtualBackground = new PlanetKitVirtualBackground();
// Register the planet-kit-virtual-background with the planet-kit.
const conferenceParams = {...};
planetKit.joinConference(conferenceParams).then(() => {
planetKit.registerVirtualBackground(virtualBackground);
});
After registering the planet-kit-virtual-background with planet-kit, you can use the virtual background feature. For more virtual background examples and APIs, see the planet-kit-virtual-background and API reference.
Improved error handling in call attempt functions
StartFailReason
has been added to provide detailed reasons for errors occurring during call attempts to Planet Cloud.- Call attempt functions (
makeCall
,verifyCall
,joinConference
) now provide detailed reasons through a structured error object.
API
Added
START_FAIL_REASON
enum 1-to-1 callGroup callMakeCallError
data class 1-to-1 callVerifyCallError
data class 1-to-1 callJoinConferenceError
data class Group call
Removed
KIT_DISCONNECT_REASON
enum 1-to-1 callGroup callPLANETKIT_DISCONNECT_REASON_WEB_BROWSER_NOT_SUPPORTED: 1612
Changed
-
Return type changed
Previous WebPlanetKit 5.3 Note function makeCall(params)
function makeCall(params): Promise
throws {MakeCallError}
1-to-1 call function verifyCall(params)
function verifyCall(params): Promise
throws {VerifyCallError}
1-to-1 call function joinConference(params)
function joinConference(params): Promise
throws {JoinConferenceError}
Group call
Add the tone sound feature
- The tone sound feature has been added. When you set the URL of the tone sound, WebPlanetKit will play the associated tone sound at the appropriate time.
API
Added
-
MakeCallParams
data class 1-to-1 callvar ringbackToneUrl?: string
var endToneUrl?: string
var playEndToneRegardlessOfCallState?: boolean
-
VerifyCallParams
data class 1-to-1 callvar ringToneUrl?: string
var endToneUrl?: string
var playEndToneRegardlessOfCallState?: boolean
-
ConferenceParams
data class Group callvar endToneUrl?: string
var playEndToneRegardlessOfCallState?: boolean
Add the debug notice feature
- The debug notice feature has been added to provide users with insight into internal warning situations or debug information.
- All events previously delivered through
evtInnerLog
have been transitioned to theevtDebugNotice
event ofKitDelegate
.
API
Added
DEBUG_NOTICE
enum 1-to-1 callGroup callKitDelegate
protocol 1-to-1 callGroup callInitConfig
data class 1-to-1 callGroup callvar delegate?: KitDelegate
Removed
MakeCallDelegate
protocol 1-to-1 callevtInnerLog(innerLogObject: InnerLogObject)
VerifyCallDelegate
protocol 1-to-1 callevtInnerLog(innerLogObject: InnerLogObject)
ConferenceDelegate
protocol Group callevtInnerLog(innerLogObject: InnerLogObject)
InnerLogObject
data class 1-to-1 callGroup callINNER_LOG_NAME
enum 1-to-1 callGroup call
Example code
const planetKit = new Conference({
...,
delegate: {
evtDebugNotice: (debugNoticeParam) => {},
},
});
Change the specification of appServerData
- The maximum size of app server data is changed to 4096 bytes.
- If the maximum data size is exceeded, the call will fail with
START_FAIL_REASON.TOO_LONG_APP_SERVER_DATA
.
Change the specification of displayName
displayName
is limited to 128 bytes, including null termination.- Any trailing part of the string that exceeds the maximum size is discarded.
Update the custom media stream setting feature
- The API for setting a custom media stream has been enhanced to be more intuitive and user-friendly, replacing previous methods such as the
initMedia
option and the video modifier APIs.
API
Added
Call
class 1-to-1 callfunction setCustomMediaStream(mediaStream: MediaStream)
function unsetCustomMediaStream()
function hasSetCustomMediaStreamWithAudio()
function hasSetCustomMediaStreamWithVideo()
Conference
class Group callfunction setCustomMediaStream(mediaStream: MediaStream)
function unsetCustomMediaStream()
function hasSetCustomMediaStreamWithAudio()
function hasSetCustomMediaStreamWithVideo()
MakeCallParams
data class 1-to-1 callvar customMediaStream?: MediaStream
VerifyCallParams
data class 1-to-1 callvar customMediaStream?: MediaStream
ConferenceParams
data class Group callvar customMediaStream?: MediaStream
EnableVideoOptions
data class 1-to-1 callGroup callvar customMediaStream?: MediaStream
Removed
Call
class 1-to-1 callfunction setVideoModifier(canvasElement: HTMLCanvasElement)
function resetVideoModifier()
Conference
class Group callfunction setVideoModifier(canvasElement: HTMLCanvasElement)
function resetVideoModifier()
MakeCallParams
data class 1-to-1 callvar initMedia?: InitMedia
VerifyCallParams
data class 1-to-1 callvar initMedia?: InitMedia
ConferenceParams
data class Group callvar initMedia?: InitMedia
EnableVideoOptions
data class 1-to-1 callGroup callvar initMedia?: InitMedia
Add view change APIs for 1-to-1 calls
- Added view change APIs to improve UI development convenience in 1-to-1 calls.
API
Added
Call
class 1-to-1 callfunction getMyMediaStream()
function changeMyView(videoElement: HTMLVideoElement, cleanOldElement?: boolean)
function changePeerView(videoElement: HTMLVideoElement, cleanOldElement?: boolean)