### Server SDK Examples Source: https://help.aliyun.com/zh/ims/developer-reference/server-sdk-calls-openapi Provides links to examples for using server-side SDKs to call OpenAPI for Intelligent Media Service (IMS). Covers installation and usage for popular programming languages. ```Java See: /zh/ims/developer-reference/java-example/ ``` ```Python See: /zh/ims/developer-reference/python-example/ ``` ```PHP See: /zh/ims/developer-reference/php-example/ ``` ```Node.js See: /zh/ims/developer-reference/node-js-example/ ``` ```Go See: /zh/ims/developer-reference/go-example/ ``` -------------------------------- ### Get URL Upload Information using Server SDK Source: https://help.aliyun.com/zh/ims/developer-reference/obtain-the-url-upload-information-4 Demonstrates how to use the Aliyun Intelligent Media Service (IMS) server-side SDK to call the OpenAPI for retrieving URL upload information. It includes setup for credentials and client, and an example call with a job ID. ```javascript import OpenApi, * as $OpenApi from '@alicloud/openapi-client'; import Credential, { Config } from '@alicloud/credentials'; const Client = require('@alicloud/ice20201109').default; // 阿里云账号AccessKey拥有所有API的访问权限,建议您使用RAM用户进行API访问或日常运维。 // 本示例以将AccessKey ID和 AccessKey Secret保存在环境变量为例说明。配置方法请参见:https://help.aliyun.com/document_detail/378664.html const cred = new Credential(); const iceClient = new Client(new $OpenApi.Config({ credential: cred, endpoint: 'ice.cn-shanghai.aliyuncs.com' })); // 如需硬编码AccessKey ID和AccessKey Secret,代码如下,但强烈建议不要把AccessKey ID和AccessKey Secret保存到工程代码里,否则可能导致AccessKey泄露,威胁您账号下所有资源的安全。 // const iceClient = new Client(new $OpenApi.Config({ // accessKeyId: '', // accessKeySecret: '', // endpoint: 'ice.cn-shanghai.aliyuncs.com' // })); // 获取URL上传信息 var jobId = "bde1a55c98694bf3bd2e01a68694****"; iceClient.getUrlUploadInfos({ jobIds: jobId }).then(function (data) { console.log(data.body); }, function (err) { console.log('Error:' + err); }); ``` -------------------------------- ### Initialize AliyunTimelinePlayer Source: https://help.aliyun.com/zh/ims/developer-reference/access-the-preview-component-web-sdk Provides a JavaScript example for initializing the AliyunTimelinePlayer with essential configuration, including container, license details, and media fetching. ```javascript const player = new window.AliyunTimelinePlayer({ container: document.querySelector('#player-wrapper'), licenseConfig: { rootDomain: "", // license使用的根域名,例如abc.com licenseKey: "", // 申请的licenseKey,没有配置licenseKey,在预览时会出现水印,没有配置license的情况下,只能在localhost的域名下预览 }, timeline: { // 可选 VideoTracks: [], // 省略 VideoTracks 的内容 AudioTracks: [], // 省略 AudioTracks 的内容 AspectRatio: '16:9', }, getMediaInfo: (mediaId) => { return Promise.resolve('https://example.com/url/for/this/media.mp4'); }, }); ``` -------------------------------- ### Initialize Aliyun ICE Client and Submit/Query Transcode Job Source: https://help.aliyun.com/zh/ims/developer-reference/transcoding-task Demonstrates initializing the Aliyun ICE client using default credentials and submitting a transcode job with OSS input and output. It also shows how to query the status of the submitted job. ```Python # 引入阿里云SDK核心包 from alibabacloud_tea_openapi.models import Config from alibabacloud_credentials.client import Client as CredClient from alibabacloud_ice20201109.client import Client as ICE20201109Client from alibabacloud_ice20201109 import models as ice20201109_models import json class Sample: # 初始化客户端 @staticmethod def create_client(region: str) -> ICE20201109Client: # 使用默认凭证初始化Credentials Client cred = CredClient() config = Config(credential = cred) # 配置云产品服务接入地址(endpoint) config.endpoint = 'ice.' + region + '.aliyuncs.com' # 使用Credentials Client初始化ECS Client return ICE20201109Client(config) # 读取命令行参数 @staticmethod def main() -> None: region = 'cn-shanghai' name = 'name' input_path = 'input path' output_path = 'output path' template_id = 'template id' # 初始化客户端 client = Sample.create_client(region) # 构造提交任务请求 request = ice20201109_models.SubmitTranscodeJobRequest( name = name, # 输入信息 input_group = [ ice20201109_models.SubmitTranscodeJobRequestInputGroup( type = 'OSS', media = input_path ) ], # 输出信息 output_group = [ ice20201109_models.SubmitTranscodeJobRequestOutputGroup( output = ice20201109_models.SubmitTranscodeJobRequestOutputGroupOutput( type = 'OSS', media = output_path ), process_config = ice20201109_models.SubmitTranscodeJobRequestOutputGroupProcessConfig( transcode = ice20201109_models.SubmitTranscodeJobRequestOutputGroupProcessConfigTranscode( template_id = template_id ) ) ) ] ) # 发送提交任务请求 response = client.submit_transcode_job(request) # 打印结果信息 print('[LOG]', json.dumps(response.to_map())) # 提取任务ID,并构造查询任务请求 job_id = response.body.transcode_parent_job.parent_job_id query_request = ice20201109_models.GetTranscodeJobRequest( parent_job_id = job_id ) # 发送查询任务情况请求 query_response = client.get_transcode_job(query_request) # 打印结果信息 print('[LOG]', json.dumps(query_response.to_map())) if __name__ == '__main__': Sample.main() ``` -------------------------------- ### Music Segment Detection Example Source: https://help.aliyun.com/zh/ims/developer-reference/api-ice-2020-11-09-queryiproductionjob Example output for MusicSegmentDetect, showing start time, end time, and title for detected music segments. ```json [{"start":39.32,"end":63.85,"title":"副歌"},{"start":86.69,"end":114.45,"title":"副歌"},{"start":135.75,"end":160.27,"title":"副歌"}] ``` -------------------------------- ### Initialize and Configure AICallEngine (Web) Source: https://help.aliyun.com/zh/ims/user-guide/use-client-side-interface-to-initiate-a-call Shows how to import the SDK, create an engine instance, and set up event listeners for various callbacks in a web application using JavaScript. ```javascript // 引入SDK import AICallEngine, { AICallErrorCode, AICallAgentState, AICallAgentType } from 'aliyun-auikit-aicall'; // 创建engine实例 const engine = new AICallEngine(); // 其他功能调用示例,请参考API说明 // 回调处理(仅示例不分核心的回调操作) engine.on('errorOccurred', (code) => { // 发生了错误 engine.handup(); }); engine.on('callBegin', () => { // 通话开始 }); engine.on('callEnd', () => { // 通话结束 }); engine.on('agentStateChanged', (state) => { // 智能体状态改变 }); engine.on('userSubtitleNotify', (subtitle) => { // 用户提问被智能体识别结果的通知 }); engine.on('agentSubtitleNotify', (subtitle) => { // 智能体回答结果通知 }); engine.on('voiceIdChanged', (voiceId) => { // 当前通话的音色发生了改变 }); engine.on('voiceInterruptChanged', (enable) => { // 当前通话的语音打断是否启用 }); // 初始化 await engine.init(agentType); ``` -------------------------------- ### Initialize AliyunTimelinePlayer Source: https://help.aliyun.com/zh/ims/use-cases/standalone-preview-player Provides a JavaScript example for initializing the AliyunTimelinePlayer with essential configuration, including container, license details, and media fetching. ```javascript const player = new window.AliyunTimelinePlayer({ container: document.querySelector('#player-wrapper'), licenseConfig: { rootDomain: "", // license使用的根域名,例如abc.com licenseKey: "", // 申请的licenseKey,没有配置licenseKey,在预览时会出现水印,没有配置license的情况下,只能在localhost的域名下预览 }, timeline: { // 可选 VideoTracks: [], // 省略 VideoTracks 的内容 AudioTracks: [], // 省略 AudioTracks 的内容 AspectRatio: '16:9', }, getMediaInfo: (mediaId) => { return Promise.resolve('https://example.com/url/for/this/media.mp4'); }, }); ``` -------------------------------- ### ARTCAICallEngine Call (Client-Initiated) Source: https://help.aliyun.com/zh/ims/user-guide/api-interface-details Initiates a call using the client-side interface to start an AI agent call. This method is used for direct client-to-agent communication setup. ```APIDOC ARTCAICallEngine.call(String rtcToken, String aiAgentInstanceId, String aiAgentUserId, String channelId) - Initiates an AI agent call via the client-side interface. - Parameters: - rtcToken: String - The token for joining the RTC session. Must not be empty. - aiAgentInstanceId: String - The instance ID of the AI agent. Must not be empty. - aiAgentUserId: String - The user ID of the AI agent. Must not be empty. - channelId: String - The ID of the communication channel or room. Must not be empty. - Returns: void ``` ```Java /** * 通过端侧呼叫接口发起智能体通话 */ public abstract void call(String rtcToken, String aiAgentInstanceId, String aiAgentUserId, String channelId); ``` -------------------------------- ### Initialize Aliyun Video Editor Web SDK (JavaScript) Source: https://help.aliyun.com/zh/ims/developer-reference/access-the-video-clip-web-sdk Demonstrates how to initialize the Aliyun Video Editor Web SDK. It covers setting up the container, locale, license configuration, enabling dynamic media sources, and defining callbacks for fetching media, managing project materials, searching media, and handling stickers. Dependencies include a custom `request` function for API calls and potentially `callDialog` for media selection. ```javascript window.AliyunVideoEditor.init({ container: document.getElementById('aliyun-video-editor'), locale: 'zh-CN', licenseConfig: { rootDomain: "", // license使用的根域名,例如abc.com licenseKey: "", // 申请的licenseKey,没有配置licenseKey,在预览时会出现水印,没有配置license的情况下,只能在localhost的域名下预览 }, useDynamicSrc: true, // 媒资库默认情况下播放地址会过期,所以需要动态获取 getDynamicSrc: (mediaId, mediaType) => new Promise((resolve, reject) => { // Example using a hypothetical 'request' function request('GetMediaInfo', { MediaId: mediaId }).then((res) => { if (res.code === '200') { resolve(res.data.MediaInfo.FileInfoList[0].FileBasicInfo.FileUrl); } else { reject(); } }); }), getEditingProjectMaterials: () => { if (projectId) { return request('GetEditingProjectMaterials', { ProjectId: projectId }).then((res) => { const data = res.data.MediaInfos; return transMediaList(data); // Requires data transformation }); } return Promise.resolve([]); }, searchMedia: (mediaType) => { return new Promise((resolve) => { // Example using a hypothetical 'callDialog' function callDialog({ onSubmit: async (materials) => { if (!projectId) { const addRes = await request('CreateEditingProject', { Title: 'xxxx', }); projectId = addRes.data.Project.ProjectId; } const valueObj = {}; materials.forEach(({ mediaType, mediaId }) => { if (!valueObj[mediaType]) { valueObj[mediaType] = mediaId; } else { valueObj[mediaType] += mediaId; } }) const res = await request('AddEditingProjectMaterials', { ProjectId: projectId, MaterialMaps: valueObj, }); if (res.code === '200') { return resolve(transMediaList(res.data.MediaInfos)); } resolve([]); } }); }); }, deleteEditingProjectMaterials: async (mediaId, mediaType) => { const res = await request('DeleteEditingProjectMaterials', { ProjectId: projectId, MaterialType: mediaType, MaterialIds: mediaId }); if (res.code === '200') return Promise.resolve(); return Promise.reject(); }, getStickerCategories: async () => { const res = await request('ListAllPublicMediaTags', { BusinessType: 'sticker', WebSdkVersion: window.AliyunVideoEditor.version }); const stickerCategories = res.data.MediaTagList.map(item => ({ id: item.MediaTagId, name: myLocale === 'zh-CN' ? item.MediaTagNameChinese : item.MediaTagNameEnglish // myLocale is the desired language })); return stickerCategories; }, getStickers: async ({ categoryId, page, size }) => { const params = { PageNo: page, PageSize: size, IncludeFileBasicInfo: true, MediaTagId: categoryId }; const res = await request('ListPublicMediaBasicInfos', params); const fileList = res.data.MediaInfos.map(item => ({ mediaId: item.MediaId, src: item.FileInfoList[0].FileBasicInfo.FileUrl })); return { total: res.data.TotalCount, stickers: fileList }; }, getEditingProject: async () => { if (projectId) { const res = await request('GetEditingProject', { ProjectId: projectId }); const timelineString = res.data.Project.Timeline; return { projectId, timeline: timelineString ? JSON.parse(timelineString) : undefined, modifiedTime: res.data.Project.ModifiedTime, title:res.data.Project.Title // Project title }; } return {}; }, updateEditingProject: ({ coverUrl, duration, timeline, isAuto }) => new Promise((resolve, reject) => { request('UpdateEditingProject', { ProjectId: projectId, CoverURL: coverUrl, Duration: duration, Timeline: JSON.stringify(timeline) }).then((res) => { // Handle response }); }) }); // Placeholder for projectId and request/callDialog functions let projectId = null; const request = async (method, params) => { console.log(`Mock request: ${method}`, params); // In a real scenario, this would make an actual API call. // For demonstration, returning mock data structure. if (method === 'GetMediaInfo') { return { code: '200', data: { MediaInfo: { FileInfoList: [{ FileBasicInfo: { FileUrl: 'http://example.com/media.mp4' }}] } } }; } else if (method === 'GetEditingProjectMaterials') { return { code: '200', data: { MediaInfos: [] } }; } else if (method === 'CreateEditingProject') { return { code: '200', data: { Project: { ProjectId: 'mock-project-id' } } }; } else if (method === 'AddEditingProjectMaterials') { return { code: '200', data: { MediaInfos: [] } }; } else if (method === 'DeleteEditingProjectMaterials') { return { code: '200' }; } else if (method === 'ListAllPublicMediaTags') { return { code: '200', data: { MediaTagList: [{ MediaTagId: 'tag1', MediaTagNameChinese: '贴纸1', MediaTagNameEnglish: 'Sticker 1' }] } }; } else if (method === 'ListPublicMediaBasicInfos') { return { code: '200', data: { TotalCount: 1, MediaInfos: [{ MediaId: 'sticker1', FileInfoList: [{ FileBasicInfo: { FileUrl: 'http://example.com/sticker.png' }}] }] } }; } else if (method === 'GetEditingProject') { return { code: '200', data: { Project: { ProjectId: 'mock-project-id', Timeline: '{}', ModifiedTime: '2023-01-01T10:00:00Z', Title: 'My Project' } } }; } else if (method === 'UpdateEditingProject') { return { code: '200' }; } return { code: '400', message: 'Not Implemented' }; }; const transMediaList = (data) => { // Placeholder for data transformation logic return data; }; const callDialog = (options) => { console.log('Mock callDialog called with:', options); // In a real scenario, this would open a UI dialog for media selection. // For demonstration, simulating a successful submission. if (options.onSubmit) { options.onSubmit([{ mediaType: 'video', mediaId: 'mock-media-id' }]); } }; const myLocale = 'zh-CN'; // Example locale variable ``` -------------------------------- ### Audio Accompaniment APIs Source: https://help.aliyun.com/zh/ims/developer-reference/ios-alirtcengine-class APIs for managing audio accompaniment playback. This includes getting file information, starting, stopping, pausing, resuming, and controlling the volume and playback position of accompaniment tracks. ```APIDOC getAudioFileInfo - Retrieves information about an audio accompaniment file. startAudioAccompanyWithFile - Starts playing an audio accompaniment file. stopAudioAccompany - Stops the playback of an audio accompaniment file. setAudioAccompanyVolume - Sets the volume for audio accompaniment. setAudioAccompanyPublishVolume - Sets the publish volume for audio accompaniment. getAudioAccompanyPublishVolume - Gets the publish volume for audio accompaniment. setAudioAccompanyPlayoutVolume - Sets the playout volume for audio accompaniment. getAudioAccompanyPlayoutVolume - Gets the playout volume for audio accompaniment. pauseAudioAccompany - Pauses the playback of audio accompaniment. resumeAudioAccompany - Resumes the playback of audio accompaniment. getAudioAccompanyDuration - Gets the total duration of an audio accompaniment file. getAudioAccompanyCurrentPosition - Gets the current playback position of the audio accompaniment. setAudioAccompanyPosition - Sets the playback position for audio accompaniment. ``` -------------------------------- ### Initialize Aliyun ICE Client Source: https://help.aliyun.com/zh/ims/developer-reference/content-library-management-9 Demonstrates how to create an Aliyun ICE client instance. It uses default credentials and configures the service endpoint based on the provided region. Ensure the necessary SDK packages are installed (`alibabacloud_tea_openapi`, `alibabacloud_credentials`, `alibabacloud_ice20201109`). ```Python from alibabacloud_tea_openapi.models import Config from alibabacloud_credentials.client import Client as CredClient from alibabacloud_ice20201109.client import Client as ICE20201109Client from alibabacloud_ice20201109 import models as ice20201109_models class Sample: # Initialize client @staticmethod def create_client(region: str) -> ICE20201109Client: # Initialize Credentials Client with default credentials cred = CredClient() config = Config(credential = cred) # Configure the service endpoint (e.g., 'ice.cn-shanghai.aliyuncs.com') config.endpoint = 'ice.' + region + '.aliyuncs.com' # Initialize ICE Client return ICE20201109Client(config) ``` -------------------------------- ### Specifying Dubbing In-point Source: https://help.aliyun.com/zh/ims/use-cases/audio-processing Mutes the original video and overlays a dubbed audio track. This example specifies that a segment from 10s to 19s of the audio file m1.wav should be inserted starting at the 5th second of the output video timeline. ```APIDOC { "VideoTracks": [ { "VideoTrackClips": [ { "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/h4.mp4", "Effects": [ { "Type": "Volume", "Gain": 0 } ] } ] } ], "AudioTracks": [ { "AudioTrackClips": [ { "MediaURL": "https://ice-document-materials.oss-cn-shanghai.aliyuncs.com/test_media/music/m1.wav", "In":10, "Out":19, "TimelineIn":5 } ] } ] } ``` -------------------------------- ### WhiteBoardSDK: Initialize and Use Source: https://help.aliyun.com/zh/ims/developer-reference/access-whiteboard Illustrates the initialization of WhiteBoardSDK, joining a room, enabling drawing, setting colors, and managing the toolbar. It also covers event listeners for document additions and deletions. ```javascript // 这里填入您的网易云信白板的 AppKey 和 AppSecret // 仅限本地开发体验,线上环境请勿露出 AppSecret const boradAppKey = ''; const boradAppSecret = ''; const boradUid = Date.now(); // 易云信白板要求是数字uid const boradNickname = boradUid.toString(); const boradChannel = '821937123'; // 创建白板实例 const boardIns = WhiteBoardSDK.getInstance({ appKey: boradAppKey, nickname: boradNickname, //非必须 uid: boradUid, container: document.getElementById('whiteboard'), platform: 'web', record: false, //是否开启录制 getAuthInfo: getAuthInfo }); let drawPluginIns; // 登录白板房间 boardIns.joinRoom({ channel: boradChannel, createRoom: true }) .then((drawPlugin) => { drawPluginIns = drawPlugin; // 允许编辑 drawPlugin.enableDraw(true); // 设置画笔颜色 drawPlugin.setColor('rgb(243,0,0)'); // 初始化工具栏 const toolCollection = ToolCollection.getInstance({ container: document.getElementById('whiteboard'), handler: drawPlugin, options: { platform: 'web' } }); toolCollection.addOrSetTool({ position: 'left', insertAfterTool: 'pan', item: { tool: 'uploadCenter', hint: '上传文档', supportPptToH5: true, supportDocToPic: true, supportUploadMedia: false, // 关闭上传多媒体文件 supportTransMedia: false, // 关闭转码多媒体文件 }, }); toolCollection.toolCollection.removeTool({ name: 'image' }); // 显示工具栏 toolCollection.show(); // 监听文档事件 toolCollection.on('docAdd', (newDocs, allDocs) => { console.log('add allDocs->', newDocs, allDocs); // 您可以在 docAdd 事件回调中将文档数据上传至您的服务端 // 建议:服务端通过白板 channel 维度去储存 }); toolCollection.on('docDelete', (newDocs, allDocs) => { console.log('delete allDocs->', newDocs, allDocs); // 您可以在 docDelete 事件回调中将文档数据上传至您的服务端 // 建议:服务端通过白板 channel 维度去储存 }); // 初始化后从服务端中获取该 channel 的文件列表,并更新至白板SDK中 // fetch('/docList', (list) => { // toolCollection.setDefaultDocList(list); // }); }); ``` -------------------------------- ### PHP SDK Example for Cloud Editing Project Management Source: https://help.aliyun.com/zh/ims/developer-reference/cloud-clip-project-management-6 This PHP code snippet demonstrates how to use the Alibaba Cloud Intelligent Media Service (ICE) SDK to manage cloud editing projects. It covers essential operations such as searching, creating, retrieving, updating, and deleting projects. The example includes setup for credentials and client configuration, and shows the typical request and response handling for each operation. ```PHP 'YOUR_AK_ID', 'accessKeySecret' => 'YOUR_AK_SECRET']); // For this example, assume Credential class is available and configured. $credential = new Credential([]); // Placeholder for actual credential setup $config = new Config([ 'credential' => $credential, 'endpoint' => 'ice.cn-shanghai.aliyuncs.com' ]); $client = new ICE($config); // 1. Search Cloud Editing Projects $searchRequest = new SearchEditingProjectRequest(); // Add search parameters if needed, e.g., $searchRequest->projectName = 'MyProject'; $searchResponse = $client->searchEditingProject($searchRequest); echo "\n--- Search Results ---"; var_dump($searchResponse); // 2. Create a Cloud Editing Project $createRequest = new CreateEditingProjectRequest(); $createRequest->title = "Test Project Title"; $createRequest->description = "Description for the test project"; // Timeline structure is crucial, especially for job submission. $createRequest->timeline = "{\"VideoTracks\":[{\"VideoTrackClips\":[{\"MediaId\":\"****9b4d7cf14dc7b83b0e801cbe****\"},{\"MediaId\":\"****9b4d7cf14dc7b83b0e801cbe****\"}]}]}"; $createRequest->coverURL = "http://xxxx/coverUrl.jpg"; $createResponse = $client->createEditingProject($createRequest); $projectId = $createResponse->body->project->projectId; echo "\n--- Create Project Response ---"; var_dump($createResponse); // 3. Get a Specific Cloud Editing Project $getRequest = new GetEditingProjectRequest(); $getRequest->projectId = $projectId; $getResponse = $client->getEditingProject($getRequest); echo "\n--- Get Project Response ---"; var_dump($getResponse); // 4. Update a Cloud Editing Project $updateRequest = new UpdateEditingProjectRequest(); $updateRequest->projectId = $projectId; // Update the timeline with an additional clip $updateRequest->timeline = "{\"VideoTracks\":[{\"VideoTrackClips\":[{\"MediaId\":\"****9b4d7cf14dc7b83b0e801cbe****\"},{\"MediaId\":\"****9b4d7cf14dc7b83b0e801cbe****\"},{\"MediaId\":\"****9b4d7cf14dc7b83b0e801cbe****\"}]}]}"; $updateResponse = $client->updateEditingProject($updateRequest); echo "\n--- Update Project Response ---"; var_dump($updateResponse); // 5. Delete Cloud Editing Projects $deleteRequest = new DeleteEditingProjectsRequest(); $deleteRequest->projectIds = $projectId; // Can be a comma-separated string for multiple IDs $deleteResponse = $client->deleteEditingProjects($deleteRequest); echo "\n--- Delete Project Response ---"; var_dump($deleteResponse); } catch (TeaUnableRetryError $e) { // Handle specific SDK exceptions echo "\n--- Error Occurred ---"; var_dump($e->getMessage()); var_dump($e->getErrorInfo()); var_dump($e->getLastException()); var_dump($e->getLastRequest()); } catch (Exception $e) { // Handle general exceptions echo "\n--- General Error ---"; var_dump($e->getMessage()); } ``` -------------------------------- ### ListLiveTranscodeJobs - Get Live Media Transcoding Job List Source: https://help.aliyun.com/zh/ims/developer-reference/api-ice-2020-11-09-listlivetranscodejobs Retrieves a list of live media transcoding jobs. This API allows filtering by job type, start mode, status, and searching by keyword. It supports pagination and sorting. ```APIDOC API: ICE/2020-11-09/ListLiveTranscodeJobs Description: 获取实时媒体转码任务列表 (Get Live Media Transcoding Job List) Method: GET or POST (depending on OpenAPI Explorer usage, typically POST for complex parameters) Authorization: - Operation: ice:ListLiveTranscodeJobs - Access Level: List - Resource Type: *全部资源 * - Condition Keywords: None - Associated Operations: None Request Parameters: - Type (string, Optional): 转码任务对应的模版类型 (Transcoding job template type). Possible values: normal, narrow-band, audio-only, origin. Example: normal - StartMode (integer, Optional): 启动模式 (Start mode). Possible values: 0 (立即启动 - Immediately start), 1 (定时启动 - Scheduled start). Example: 0 - Status (integer, Optional): 任务状态 (Job status). Possible values: 0 (未启动 - Not started), 1 (运行中 - Running), 2 (已停止 - Stopped). Example: 1 - PageNo (integer, Optional): 分页的页码 (Page number). Default: 1. Example: 1 - PageSize (integer, Optional): 分页大小,每页显示条数 (Page size, number of items per page). Default: 10, Max: 100. Example: 20 - SortBy (string, Optional): 排序,按 CreateTime 排序 (Sort by CreateTime). Possible values: asc (正序 - Ascending), desc (倒序 - Descending). Default: desc. Example: asc - KeyWord (string, Optional): 搜索关键词 (Search keyword). Supports job ID/name, and fuzzy search for name. Example: 24ecbb5c-4f98-4194-9400-f17102e27fc5 Response Parameters: - RequestId (string): 请求 ID (Request ID). Example: ******3B-0E1A-586A-AC29-742247****** - TotalCount (integer): 总数 (Total number of jobs). Example: 100 - JobList (array): 转码任务列表 (List of transcoding jobs). - job (object): - Name (string): 转码任务名称 (Transcoding job name). Example: mytask - JobId (string): 任务 ID (Job ID). Example: ****a046-263c-3560-978a-fb287782**** - TemplateType (string): 转码任务对应转码模版的类型 (Transcoding job's template type). Example: normal - TemplateId (string): 转码任务对应的模板 ID (Transcoding job's template ID). Example: ****a046-263c-3560-978a-fb287666**** - TemplateName (string): 模板名称 (Template name). Example: 模板1 - StartMode (integer): 启动模式 (Start mode). Example: 0 - Status (integer): 任务状态 (Job status). Example: 1 - StreamInput (object): 输入流信息 (Input stream information). - Type (string): 输入流类型 (Input stream type). Example: rtmp - InputUrl (string): 输入流地址 (Input stream URL). Example: rtmp://mydomain/app/stream1 - OutputStream (object): 输出流信息 (Output stream information). - StreamInfos (array): 播放地址列表 (List of playback URLs). - streamInfo (object): - Type (string): 输出流协议类型 (Output stream protocol type). Currently only supports rtmp. Example: rtmp - OutputUrl (string): 输出流地址 (Output stream URL). Example: rtmp://mydomain/app/mytranscode1 - CreateTime (string): 创建时间 (Creation time). Example: 2022-07-20T02:48:58Z Example Response (JSON): ```json { "RequestId": "******3B-0E1A-586A-AC29-742247******", "TotalCount": 100, "JobList": [ { "Name": "mytask", "JobId": "****a046-263c-3560-978a-fb287782****", "TemplateType": "normal", "TemplateId": "****a046-263c-3560-978a-fb287666****", "TemplateName": "模板1", "StartMode": 0, "Status": 1, "StreamInput": { "Type": "rtmp", "InputUrl": "rtmp://mydomain/app/stream1" }, "OutputStream": { "StreamInfos": [ { "Type": "rtmp", "OutputUrl": "rtmp://mydomain/app/mytranscode1" } ] }, "CreateTime": "2022-07-20T02:48:58Z" } ] } ``` Error Codes: Refer to the Error Center for more error codes: https://api.aliyun.com/document/ICE/2020-11-09/errorCode ```