Skip to main content
Version: 5.3

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 a MediaStream using media devices.
  • The created MediaStreamManager instance can easily be applied to MakeCallParams, VerifyCallParams, ConferenceParams or EnableVideoOptions for seamless interaction with WebPlanetKit.

API

Added
  • MediaStreamManager class 1-to-1 callGroup call
  • MakeCallParams data class 1-to-1 call
    • var mediaStreamManager?: MediaStreamManager
  • VerifyCallParams data class 1-to-1 call
    • var mediaStreamManager?: MediaStreamManager
  • ConferenceParams data class Group call
    • var mediaStreamManager?: MediaStreamManager
  • EnableVideoOptions data class 1-to-1 callGroup call
    • var 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 call

    • function 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 call

    • function 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 call

    • function 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 call
  • MakeCallError data class 1-to-1 call
  • VerifyCallError data class 1-to-1 call
  • JoinConferenceError data class Group call
Removed
  • KIT_DISCONNECT_REASON enum 1-to-1 callGroup call
    • PLANETKIT_DISCONNECT_REASON_WEB_BROWSER_NOT_SUPPORTED: 1612
Changed
  • Return type changed

    PreviousWebPlanetKit 5.3Note
    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 call

    • var ringbackToneUrl?: string
    • var endToneUrl?: string
    • var playEndToneRegardlessOfCallState?: boolean
  • VerifyCallParams data class 1-to-1 call

    • var ringToneUrl?: string
    • var endToneUrl?: string
    • var playEndToneRegardlessOfCallState?: boolean
  • ConferenceParams data class Group call

    • var 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 the evtDebugNotice event of KitDelegate.

API

Added
  • DEBUG_NOTICE enum 1-to-1 callGroup call
  • KitDelegate protocol 1-to-1 callGroup call
  • InitConfig data class 1-to-1 callGroup call
    • var delegate?: KitDelegate
Removed
  • MakeCallDelegate protocol 1-to-1 call
    • evtInnerLog(innerLogObject: InnerLogObject)
  • VerifyCallDelegate protocol 1-to-1 call
    • evtInnerLog(innerLogObject: InnerLogObject)
  • ConferenceDelegate protocol Group call
    • evtInnerLog(innerLogObject: InnerLogObject)
  • InnerLogObject data class 1-to-1 callGroup call
  • INNER_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 call
    • function setCustomMediaStream(mediaStream: MediaStream)
    • function unsetCustomMediaStream()
    • function hasSetCustomMediaStreamWithAudio()
    • function hasSetCustomMediaStreamWithVideo()
  • Conference class Group call
    • function setCustomMediaStream(mediaStream: MediaStream)
    • function unsetCustomMediaStream()
    • function hasSetCustomMediaStreamWithAudio()
    • function hasSetCustomMediaStreamWithVideo()
  • MakeCallParams data class 1-to-1 call
    • var customMediaStream?: MediaStream
  • VerifyCallParams data class 1-to-1 call
    • var customMediaStream?: MediaStream
  • ConferenceParams data class Group call
    • var customMediaStream?: MediaStream
  • EnableVideoOptions data class 1-to-1 callGroup call
    • var customMediaStream?: MediaStream
Removed
  • Call class 1-to-1 call
    • function setVideoModifier(canvasElement: HTMLCanvasElement)
    • function resetVideoModifier()
  • Conference class Group call
    • function setVideoModifier(canvasElement: HTMLCanvasElement)
    • function resetVideoModifier()
  • MakeCallParams data class 1-to-1 call
    • var initMedia?: InitMedia
  • VerifyCallParams data class 1-to-1 call
    • var initMedia?: InitMedia
  • ConferenceParams data class Group call
    • var initMedia?: InitMedia
  • EnableVideoOptions data class 1-to-1 callGroup call
    • var 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 call
    • function getMyMediaStream()
    • function changeMyView(videoElement: HTMLVideoElement, cleanOldElement?: boolean)
    • function changePeerView(videoElement: HTMLVideoElement, cleanOldElement?: boolean)