Revision record

Version recorder date judges Review content
0.1 张龙 2019/4

[TOC]

1 Overview

1.1 Background

This SDK interface is suitable for mac os and windows platforms.

Developers can develop in HTML or JS based on this interface.

The main functions include screen capture, exit screen, full screen interface, etc.

The bottom screencast protocol uses BJCast

1.2 Reader

Developers and testers who use this development kit for development。

1.3 Definition of abbreviations

abbreviations
BJCast The private protocal developed by BiJie

2 Interface

2.1 Start ScreenCast

function startBJCastSession(ip, port, pin, onSessionEnd,onStartSessionFailed)

  • Function:Start ScreenCast
  • Input :
    • ip: receiver IP,is String type.
    • port: BJCast service port,BJCast receiver use port 8188 to provide ScreenCast access services,is Number type.
    • pin: ScreenCast PIN,if there is no pin,then type in NULL or null character,the default is NULL,String type.
    • onSessionEnd: Notification function at the end of the session,Function yype,implemented by the user,SDK internal calls.
    • onSessionEnd(err:err refers to the reason of fault,Number integer. The error code can refer to 3.9
    • onStartSessionFailed:Notification function for session creation failure,Function type,Implemented by the user,SDK internal call. The error code can refer to 3.9
    • onStartSessionFailed(err)entry parameter:err refers to the reason of fault,Number type
  • Output :
    null
  • Return parameter:
    null
  • Others:
    If startScreenCast fails,The reason why the application ScreenCast session ends is notified via the application notification interface onCallEnd.

2.2 End ScreenCast

function stopBJCastSession ()

  • Function:
    End ScreenCast session
  • Input:
    null
  • output :
    null
  • return:
    Return 0 (Number type):success
    Others :fail

    2.3 Set ScreenCast’s model

    function setMirrorMode(mode)

  • function:
    Set ScreenCast’s mode,ScreenCast has following modes:

    • 0Screensharing, //office mode,suit for apps like PPT
    • 1RealtimeVideo, //movie mode
    • 2: Performance //performance mode
  • input :
    An integer of type Number between 0 and 2
  • output :
    null
  • return:
    Return 0 (Number type):success

    2.4 Get the number of screens

    function getScreenCount()

  • function:
    Get the number of screens,usually is 1,If connected two screens, it’s 2.
  • input :
    null
  • output :
    null
  • return:
    Return Number type,represents the number of screens,generally is 1,If connected two screens, it’s 2.

2.5 Set the screen

function setScreen(screen)

  • function:
    Set which screen is to be recorded at the current launch,this interface can take effect dynamically. Defaults is the main screen.
  • input :
    • Screen : Number type ,show screen index,The value range is 0(screenCount()-1)
      When multiple screens exist, 0 is the primary screen and 1 is the auxiliary screen
  • output :
    null
  • return:
    null

2.6 Gets the number of audio acquisition devices.

function getAudioDeviceCount()

  • function:
    Gets the number of audio acquisition devices.
  • input :
    null
  • output :
    null
  • return:
    Return 0 (Number type) represents the number of audio acquisition interfaces,span >=0

2.7 Get the name of the audio acquisition device

function getAudioDeviceName(index,name)

  • function:
    Get the name of the audio acquisition device
  • input :
    Index: Number type ,represents the audio acquisition device index,the value range is 0(micphoneCount()-1)
    name:String type,indicates the name of the audio collection device.
  • output :
    Name: represent the name of the audio acquisition device.
  • return:
    null
  • Other :
    Valid for windows only,mac doesn’t have

2.8 Select audio acquisition equipment

function selectAudioDevice(index)

  • function:
    for selecting audio data for recording a particular audio collection interface in ScreenCastfunction.
  • input :
    Index: Number type, represents the audio acquisition device index,value range is 0(micphoneCount()-1)
  • output :
    null
  • return:
    null
  • others:
    Valid for windows only,mac doesn’t have a interface for playing sound in the system of the admission system

2.9 Error code description

The meaning of common error codes involved in applications: Error code description Appearance scene
0 success Normal end of ScreenCast
-1 Unknown cause failed
-6 Failed to connect to the receiver, check if the network is normal Network anomaly
-7 Session Timeout After Login,No start ScreenCast session for 15 seconds.
-14 ScreenCast session is refused Receiver denies ScreenCast session access
-15 The receiver screen is full and cannot be accessed The receiver screen is full and cannot be accessed
-16 ScreenCast code is wrong ScreenCast code is wrong