您可以利用导播服务API,构建定制化的控制台或者前端页面。

阅读对象

  • 具备java或者PHP开发能力

  • 了解导播产品的基本功能

  • 了解视频直播的基本功能

特别说明

  • 请您区分 导播服务云导播台,导播服务仅提供API服务,您需要自行开发完成前端页面与交互部分,该文档适用于导播服务。

  • 云导播台用户请忽略该文档,视频直播控制提供云导播台产品,可直接使用前端页面进行导播操作。

准备

  • 开通视频点播服务,并绑定域名

  • 开通视频直播服务,并绑定域名

  • 初始导播台实例(通过控制台方式,按照流程指引设置、付费后自动创建导播台实例)

  • 获取视频直播SDK 并使用

导播操作

步骤 1:配置导播台
  • 步骤说明

    导播台创建完毕后,根据使用需求完成导播台名称、域名、转码、录制、延播、备播素材等配置。

  • 前提条件
    • 需提供经过备案的域名

    • 需要开通阿里云直播和点播服务

  • 接口说明
    • 设置导播台配置信息(SetCasterConfig

    • 将客户提供的域名domainName绑定至导播台实例

    • 配置导播台输出分辨率casterTemplate

    • 配置导播台直播转码参数liveTemplate

    • 配置导播台直播录制参数recordConfig

    • 延播秒数及备播素材ID

  • 程序示例
     IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    SetCasterConfigRequest setCasterConfigRequest = new SetCasterConfigRequest();
    setCasterConfigRequest.setCasterId("XXXXXX");
    setCasterConfigRequest.setCasterName("XXXXXX");
    setCasterConfigRequest.setDomainName("XXXXXX");
    setCasterConfigRequest.setDelay(10F);
    setCasterConfigRequest.setUrgentMaterialId("XXXXXX");
    JSONObject transcodeConfig = new JSONObject();
    JSONArray liveTemplate = new JSONArray();
    liveTemplate.add("lld");
    transcodeConfig.put("LiveTemplate", liveTemplate);
    transcodeConfig.put("CasterTemplate", "lp_ld"); // 导播台分辨率,lp_ld-流畅,lp_sd-标清,lp_hd-高清,lp_ud-超清
    JSONObject recordConfig = new JSONObject();
    JSONArray videoFormat = new JSONArray();
    videoFormat.add(new JSONObject().fluentPut("Format", "flv").fluentPut("OssObjectPrefix", "record/{AppName}/{StreamName}/{StartTime}_{EndTime}").fluentPut("CycleDuration", 15*60));
    videoFormat.add(new JSONObject().fluentPut("Format", "m3u8").fluentPut("OssObjectPrefix", "record/{AppName}/{StreamName}/{StartTime}_{EndTime}").fluentPut("SliceOssObjectPrefix", "record/{AppName}/{StreamName}/{UnixTimestamp}").fluentPut("CycleDuration", 15*60));
    recordConfig.put("VideoFormat", videoFormat);
    recordConfig.put("OssBucket", "ossBucket");
    recordConfig.put("OssEndpoint", "ossEndpoint");
    setCasterConfigRequest.setRecordConfig(recordConfig.toJSONString());
    setCasterConfigRequest.setTranscodeConfig(transcodeConfig.toJSONString());
    setCasterConfigRequest.setCallbackUrl(“http://XXX“);
    SetCasterConfigResponse response = iAcsClient.getAcsResponse(setCasterConfigRequest);
    
步骤 2:编辑视频源
  • 步骤说明

    导播台创建完毕后,可配置用于输出的视频源信息,目前支持直播流及点播素材两种类型。

  • 前提条件

    完成导播台实例创建。

  • 接口说明

    • 新增视频源(AddCasterVideo

    • 修改视频源(ModifyCasterVideoResource

    • 查询视频源列表(DescribeCasterVideoResources

    • 删除视频源(DeleteCasterVideoResource

    • 配置视频源地址,视频源类型为直播流时需提供直播流地址liveStreamUrl,视频源类型为点播素材时需提供点播素材ID materialId及循环播放次数repeatNum

    • 配置视频源名称及视频源位置locationId,作为布局画面的引用编号

  • 程序示例
     // 新增视频源(AddCasterVideo)
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    AddCasterVideoResourceRequest addCasterVideoResourceRequest = new AddCasterVideoResourceRequest();
    addCasterVideoResourceRequest.setCasterId("XXXXXX");
    addCasterVideoResourceRequest.setResourceName("XXXXXX");
    addCasterVideoResourceRequest.setLocationId("RV01" ); // RV01-RV12视频源的RVXX代表位置ID,不可重复,布局通过该ID引用视频源
    addCasterVideoResourceRequest.setLiveStreamUrl( null); // 采用点播素材时不输入
    addCasterVideoResourceRequest.setMaterialId("XXXXXX");
    addCasterVideoResourceRequest.setRepeatNum( -1); // 视频播放完毕后循环播放
    AddCasterVideoResourceResponse response = iAcsClient.getAcsResponse(addCasterVideoResourceRequest);
    
    // 修改视频源(AddCasterVideo)
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    ModifyCasterVideoResourceRequest modifyCasterVideoResourceRequest = new ModifyCasterVideoResourceRequest();
    modifyCasterVideoResourceRequest.setCasterId("XXXXXX");
    modifyCasterVideoResourceRequest.setResourceId("XXXXXX");
    modifyCasterVideoResourceRequest.setLiveStreamUrl(“rtmp://XXXX“);
    modifyCasterVideoResourceRequest.setResourceName("XXXXXX");
    ModifyCasterVideoResourceResponse response = iAcsClient.getAcsResponse(modifyCasterVideoResourceRequest);
    
    // 查询视频源列表(DescribeCasterVideo)
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    DescribeCasterVideoResourcesRequest describeCasterVideoResourcesRequest = new DescribeCasterVideoResourcesRequest();
    describeCasterVideoResourcesRequest.setCasterId("XXXXXX");
    DescribeCasterVideoResourcesResponse response = iAcsClient.getAcsResponse(describeCasterVideoResourcesRequest);
    
    // 删除视频源列表(DescribeCasterVideo)
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    DeleteCasterVideoResourceRequest deleteCasterVideoResourceRequest = new DeleteCasterVideoResourceRequest();
    deleteCasterVideoResourceRequest.setCasterId("XXXXXX");
    deleteCasterVideoResourceRequest.setResourceId("XXXXXX");
    DeleteCasterVideoResourceResponse response = iAcsClient.getAcsResponse(deleteCasterVideoResourceRequest);
    
步骤 3: 编辑组件
  • 步骤说明

    导播台创建完毕后,可配置用于输出的组件信息,目前支持文字及图片两种类型。

  • 前提条件

    完成导播台实例创建。

  • 接口说明

    • 新增组件(AddCasterComponent

    • 修改组件(ModifyCasterComponent

    • 查询组件列表(DescribeCasterComponents

    • 删除组件(DeleteCasterComponent

    • 配置组件内容,文字组件需提供文字内容、字体归一化比例、颜色等,图片组件需提供图片素材ID

  • 程序示例
    // 新增组件(AddCasterComponent)
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    JSONObject componentLayer = new JSONObject();
    componentLayer.put("HeightNormalized", 0.2);
    componentLayer.put("WidthNormalized", 0.2);
    JSONArray positionNormalized = new JSONArray();
    positionNormalized.add("0.3");
    positionNormalized.add("0.3");
    componentLayer.put("PositionNormalized", positionNormalized);
    componentLayer.put("PositionRefer", "topLeft");
    JSONObject textLayerContent = new JSONObject(); // 组件TextLayerContent
    textLayerContent.put("Text", text);
    textLayerContent.put("Color", 0xff0000);
    textLayerContent.put("FontName", "KaiTi");
    textLayerContent.put("SizeNormalized", 0.3F);
    textLayerContent.put("BorderWidthNormalized", 0.3F);
    textLayerContent.put("BorderColor", 0xff0000);
    AddCasterComponentRequest addCasterComponntRequest = new AddCasterComponentRequest(); // 设置组件元素属性
    addCasterComponntRequest.setCasterId(casterId);
    addCasterComponntRequest.setLocationId(locationId);
    addCasterComponntRequest.setComponentName(componentName);
    addCasterComponntRequest.setComponentType("text");
    addCasterComponntRequest.setEffect(effect);
    addCasterComponntRequest.setComponentLayer(componentLayer.toJSONString());
    addCasterComponntRequest.setTextLayerContent(textLayerContent.toJSONString());
    AddCasterComponentResponse response = iAcsClient.getAcsResponse(addCasterComponntRequest);
    
    // 修改组件(ModifyCasterComponent)
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    JSONObject componentLayer = new JSONObject();
    componentLayer.put("HeightNormalized", 0.6);
    componentLayer.put("WidthNormalized", 0.6);
    JSONArray positionNormalized = new JSONArray();
    positionNormalized.add("0.3");
    positionNormalized.add("0.3");
    componentLayer.put("PositionNormalized", positionNormalized);
    componentLayer.put("PositionRefer", "topLeft");
    JSONObject textLayerContent = new JSONObject();// 组件TextLayerContent
    textLayerContent.put("Text", text);
    textLayerContent.put("Color", 0xff0000);
    textLayerContent.put("FontName", "KaiTi");
    textLayerContent.put("SizeNormalized", 0.3F);
    textLayerContent.put("BorderWidthNormalized", 0.3F);
    textLayerContent.put("BorderColor", 0xff0000);
    ModifyCasterComponentRequest modifyCasterComponentRequest = new ModifyCasterComponentRequest(); // 设置组件元素属性
    modifyCasterComponentRequest.setCasterId("XXXXXX");
    modifyCasterComponentRequest.setComponentId("XXXXXX");
    modifyCasterComponentRequest.setComponentName("XXXXXX");
    modifyCasterComponentRequest.setComponentType("text"); // 文本类型
    modifyCasterComponentRequest.setEffect("none"); // 无特效
    modifyCasterComponentRequest.setComponentLayer(componentLayer.toJSONString());
    modifyCasterComponentRequest.setTextLayerContent(textLayerContent.toJSONString());
    ModifyCasterComponentResponse response = iAcsClient.getAcsResponse(modifyCasterComponentRequest);
    
    // 查询组件列表(DescribeCasterComponents)
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    DescribeCasterComponentsRequest describeCasterComponentsRequest= new DescribeCasterComponentsRequest();
    describeCasterComponentsRequest.setCasterId("XXXXXX");
    DescribeCasterComponentsResponse response = iAcsClient.getAcsResponse(describeCasterComponentsRequest);
    
    // 删除组件列表(DescribeCasterComponent)
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    DeleteCasterComponentRequest deleteCasterComponentRequest = new DeleteCasterComponentRequest();
    deleteCasterComponentRequest.setCasterId("XXXXXX");
    deleteCasterComponentRequest.setComponentId("XXXXXX");
    DeleteCasterComponentResponse response = iAcsClient.getAcsResponse(deleteCasterComponentRequest);
    
步骤 4:编辑布局
  • 步骤说明

    导播台创建完毕后,可配置用于导播输出的画面布局,用户可自定义画面及位置,目前支持最多四个画面。

  • 前提条件

    完成导播台实例创建

  • 接口说明
    • 新增布局(AddCasterLayout

    • 修改布局(ModifyCasterLayout

    • 查询布局列表(DescribeCasterLayouts

    • 删除视频源(DeleteCasterLayout

    • 配置布局样式信息列表 videoLayer、音频配置信息列表 audioLayer

    • 配置视频源位置列表 blendList、音频位置列表 mixList

  • 程序示例
      // 新增布局(AddCasterLayout)
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    JSONObject componentLayer = new JSONObject();
    componentLayer.put("HeightNormalized", 0.6);
    componentLayer.put("WidthNormalized", 0.6);
    JSONArray positionNormalized = new JSONArray();
    positionNormalized.add("0.3");
    positionNormalized.add("0.3");
    componentLayer.put("PositionNormalized", positionNormalized);
    componentLayer.put("PositionRefer", "topLeft");
    JSONObject imageLayerContent = new JSONObject(); // 组件ImageLayerContent
    imageLayerContent.put("MaterialId", "materailId");
    AddCasterComponentRequest addCasterComponntRequest = new AddCasterComponentRequest(); // 设置组件元素属性
    addCasterComponntRequest.setCasterId("XXXXXX");
    addCasterComponntRequest.setLocationId("RC01"); // 与组件关联的LocationId
    addCasterComponntRequest.setComponentName("XXXXXX");
    addCasterComponntRequest.setComponentType("image"); // 图片类型
    addCasterComponntRequest.setEffect("none"); // 无特效
    addCasterComponntRequest.setComponentLayer(componentLayer.toJSONString());
    addCasterComponntRequest.setImageLayerContent(imageLayerContent.toJSONString());
    AddCasterComponentResponse response = iAcsClient.getAcsResponse(addCasterComponntRequest);
    
    // 修改布局(ModifyCasterLayout)
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    ModifyCasterLayoutRequest modifyCasterLayoutRequest = new ModifyCasterLayoutRequest();
    modifyCasterLayoutRequest.setCasterId("XXXXXX");
    modifyCasterLayoutRequest.setLayoutId("XXXXXX");
    List videoLayersList = new ArrayList(); // 视频layer
    ModifyCasterLayoutRequest.VideoLayer videoLayer1 = new ModifyCasterLayoutRequest.VideoLayer();
    videoLayer1.setHeightNormalized(0.5F);
    videoLayer1.setWidthNormalized(0.5F);
    videoLayer1.setPositionRefer("topLeft");
    videoLayer1.setPositionNormalizeds(Arrays.asList(new Float[]{0F, 0F}));
    videoLayersList.add(videoLayer1);
    ModifyCasterLayoutRequest.VideoLayer videoLayer2 = new ModifyCasterLayoutRequest.VideoLayer();
    videoLayer2.setHeightNormalized(0.5F);
    videoLayer2.setWidthNormalized(0.5F);
    videoLayer2.setPositionRefer("topLeft");
    videoLayer2.setPositionNormalizeds(Arrays.asList(new Float[]{0.5F, 0F}));
    videoLayersList.add(videoLayer2);
    ModifyCasterLayoutRequest.VideoLayer videoLayer3 = new ModifyCasterLayoutRequest.VideoLayer();
    videoLayer3.setHeightNormalized(0.5F);
    videoLayer3.setWidthNormalized(0.5F);
    videoLayer3.setPositionRefer("topLeft");
    videoLayer3.setPositionNormalizeds(Arrays.asList(new Float[]{0.2F, 0.5F}));
    videoLayersList.add(videoLayer3);
    modifyCasterLayoutRequest.setVideoLayers(videoLayersList);
    List audioLayerList = new ArrayList();
    ModifyCasterLayoutRequest.AudioLayer audioLayer1 = new ModifyCasterLayoutRequest.AudioLayer(); // 音频layer
    audioLayer1.setVolumeRate(1F);
    audioLayer1.setValidChannel("all");
    audioLayerList.add(audioLayer1);
    ModifyCasterLayoutRequest.AudioLayer audioLayer2 = new ModifyCasterLayoutRequest.AudioLayer();
    audioLayer2.setVolumeRate(1F);
    audioLayer2.setValidChannel("all");
    audioLayerList.add(audioLayer2);
    ModifyCasterLayoutRequest.AudioLayer audioLayer3 = new ModifyCasterLayoutRequest.AudioLayer();
    audioLayer3.setVolumeRate(1F);
    audioLayer3.setValidChannel("all");
    audioLayerList.add(audioLayer3);
    modifyCasterLayoutRequest.setAudioLayers(audioLayerList);
    modifyCasterLayoutRequest.setBlendLists(Arrays.asList(new String[]{"RV01", "RV02", "RV03"}));
    modifyCasterLayoutRequest.setMixLists(Arrays.asList(new String[]{"RV01", "RV02", "RV03"}));
    ModifyCasterLayoutResponse response = iAcsClient.getAcsResponse(modifyCasterLayoutRequest);
    
    // 查询布局列表(DescribeCasterLayout)
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    DescribeCasterLayoutsRequest request = new DescribeCasterLayoutsRequest();
    request.setCasterId("XXXXXX");
    DescribeCasterLayoutsResponse response = iAcsClient.getAcsResponse(request);
    
    // 删除布局(DescribeCasterLayout)
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    DeleteCasterLayoutRequest deleteCasterLayoutRequest = new DeleteCasterLayoutRequest();
    deleteCasterLayoutRequest.setCasterId("XXXXXX");
    deleteCasterLayoutRequest.setLayoutId("XXXXXX");
    DeleteCasterLayoutResponse response = iAcsClient.getAcsResponse(deleteCasterLayoutRequest);
    
步骤 5:启动导播台
  • 步骤说明

    导播台创建并配置完毕后,即可启动导播台,启动底层音视频处理任务。

  • 前提条件
    • 完成导播台实例创建

    • 完成导播台配置,包括域名、导播台输出分辨率等

  • 接口说明
    • 启动导播台(StartCaster

    • 指定需要启动的导播台实例ID CasterID

    • 接口启动成功后返回PVW及PGM场景信息列表,包括场景ID及流信息等,后续操作指定场景时指定场景ID即可。

  • 程序示例
     // 启动导播台(StartCaster)
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    StartCasterSceneRequest startCasterSceneRequest = new StartCasterSceneRequest();
    startCasterSceneRequest.setCasterId("XXXXXX");
    startCasterSceneRequest.setSceneId("XXXXXX");
    StartCasterSceneResponse response = iAcsClient.getAcsResponse(startCasterSceneRequest);
    
步骤 6:更新场景
  • 步骤说明

    导播台启动成功后,可将已配置好的布局(组件)生效至指定场景。

  • 前提条件
    • 完成导播台实例创建

    • 完成指定布局(组件)的编辑

    • 指定场景存在并启动

  • 接口说明
    • 更新场景配置(UpdateCasterSceneConfig

    • 删除场景配置(DeleteCasterSceneConfig

    • 指定导播台实例ID CasterID

    • 指定场景ID SceneID

    • 指定布局ID LayoutID,若未指定则默认无变更。

  • 程序示例
    // 更新场景配置(UpdateCasterSceneConfig)
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    UpdateCasterSceneConfigRequest updateCasterSceneConfigRequest = new UpdateCasterSceneConfigRequest();
    updateCasterSceneConfigRequest.setCasterId("XXXXXX");
    updateCasterSceneConfigRequest.setLayoutId("XXXXXX");
    updateCasterSceneConfigRequest.setSceneId("XXXXXX");
    updateCasterSceneConfigRequest.setComponentIds(componentList);
    UpdateCasterSceneConfigResponse response = iAcsClient.getAcsResponse(updateCasterSceneConfigRequest);
    
    // 删除场景配置(DeleteCasterSceneConfig)
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    DeleteCasterSceneConfigRequest deleteCasterSceneConfigRequest = new DeleteCasterSceneConfigRequest();
    deleteCasterSceneConfigRequest.setCasterId("XXXXXX");
    deleteCasterSceneConfigRequest.setLayoutId("XXXXXX");
    deleteCasterSceneConfigRequest.setType("Component") // 清除场景中的组件配置
    DeleteCasterSceneConfigResponse response = iAcsClient.getAcsResponse(deleteCasterSceneConfigRequest);
    
步骤 7:PVW切换到PGM
  • 步骤说明

    导播台启动成功后,可将PVW的布局配置信息设置到PGM场景。

  • 前提条件
    • 完成导播台实例创建

    • PVW场景存在并启动

    • PGM场景存在并启动

  • 接口说明
    • 更新场景配置(CopyCasterSceneConfig

    • 指定导播台实例ID CasterID

    • 指定PVW场景ID FromSceneID

    • 指定PGM场景ID ToSceneID

  • 程序示例
    // 场景切换(CopyCasterSceneConfig)
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    CopyCasterSceneConfigRequest copyCasterSceneConfigRequest = new CopyCasterSceneConfigRequest();
    copyCasterSceneConfigRequest.setCasterId("XXXXXX");
    copyCasterSceneConfigRequest.setFromSceneId("XXXXXX");
    copyCasterSceneConfigRequest.setToSceneId("XXXXXX");
    CopyCasterSceneConfigResponse response = iAcsClient.getAcsResponse(copyCasterSceneConfigRequest);
    
步骤 8:预监开启、关闭
  • 步骤说明

    导播台启动成功后,可通过预监开启、关闭服务控制PVW场景,关闭PVW场景后布局及视频源变动可直接生效至PGM场景。

  • 前提条件
    • 完成导播台实例创建

    • PVW场景存在

  • 接口说明
    • 预监开启(StartCasterScene

    • 预监关闭(StopCasterScene

    • 指定导播台实例ID CasterID

    • 指定PVW场景ID SceneID

  • 程序示例
     /// 预监开启(StartCasterScene)
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    StartCasterSceneRequest startCasterSceneRequest = new StartCasterSceneRequest();
    startCasterSceneRequest.setCasterId("XXXXXX");
    startCasterSceneRequest.setSceneId("XXXXXX");
    StartCasterSceneResponse response = iAcsClient.getAcsResponse(startCasterSceneRequest);
    
    // 预监关闭(StopCasterScene)
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    StopCasterSceneRequest stopCasterSceneRequest = new StopCasterSceneRequest();
    stopCasterSceneRequest.setCasterId("XXXXXX");
    stopCasterSceneRequest.setSceneId("XXXXXX");
    StopCasterSceneResponse response = iAcsClient.getAcsResponse(stopCasterSceneRequest);
    
步骤 9:备播切换、切回
  • 步骤说明

    导播台启动成功后,可通过备播切换服务将PGM场景切换至备播画面,若需要切回直播场景可通过回切直播服务完成。

  • 前提条件
    • 导播台实例已启动

    • 完成备播素材ID配置

  • 接口说明
    • 备播紧急生效(EffectCasterUrgent

    • 切回直播(SetCasterSceneConfig

    • 指定导播台实例ID (CasterID

    • 指定PGM场景实例ID (SceneID

  • 程序示例
     // 切换备播(StartCasterScene)
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    EffectCasterUrgentRequest effectCasterUrgentRequest = new EffectCasterUrgentRequest();
    effectCasterUrgentRequest.setCasterId("XXXXXX");
    effectCasterUrgentRequest.setSceneId("XXXXXX");
    EffectCasterUrgentResponse response = iAcsClient.getAcsResponse(effectCasterUrgentRequest);
    
    // 切回直播(SetCasterSceneConfig)
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    SetCasterSceneConfigRequest setCasterSceneConfigRequest = new SetCasterSceneConfigRequest();
    setCasterSceneConfigRequest.setCasterId("XXXXXX");
    setCasterSceneConfigRequest.setSceneId("XXXXXX");
    setCasterSceneConfigRequest.setLayoutId(null); // 若需要退出备播播放传null,若需要转到指定布局输入layoutId即可
    SetCasterSceneConfigResponse response = iAcsClient.getAcsResponse(setCasterSceneConfigRequest);
    
步骤 10:停止导播台
  • 步骤说明

    导播台启动成功后,可通过停止导播台服务停止指定导播台及底层音视频任务。

  • 前提条件

    导播台实例已启动

  • 接口说明
    • 停止导播台(StopCaster

    • 指定导播台实例ID CasterID

  • 程序示例
       // 停止导播台(StopCaster)
    IAcsClient iAcsClient = new DefaultAcsClient(DefaultProfile.getProfile("regionId", "accessKeyId", "secret"));
    StopCasterRequest request = new StopCasterRequest();
    request.setCasterId("XXXXXX");
    StopCasterResponse response = iAcsClient.getAcsResponse(request);