-
Notifications
You must be signed in to change notification settings - Fork 99
/
live_client.js
1094 lines (1083 loc) · 44.6 KB
/
live_client.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Client = void 0;
/* eslint-disable @typescript-eslint/no-unused-vars */
/*
* Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
const abstract_client_1 = require("../../../common/abstract_client");
/**
* live client
* @class
*/
class Client extends abstract_client_1.AbstractClient {
constructor(clientConfig) {
super("live.tencentcloudapi.com", "2018-08-01", clientConfig);
}
/**
* 断开推流连接,但可以重新推流。
注:对已经不活跃的流,调用该断流接口时,接口返回成功。
*/
async DropLiveStream(req, cb) {
return this.request("DropLiveStream", req, cb);
}
/**
* 查询水印列表。
*/
async DescribeLiveWatermarks(req, cb) {
return this.request("DescribeLiveWatermarks", req, cb);
}
/**
* 查询并发录制路数,对慢直播和普通直播适用。
*/
async DescribeConcurrentRecordStreamNum(req, cb) {
return this.request("DescribeConcurrentRecordStreamNum", req, cb);
}
/**
* - 使用前提
1. 录制文件存放于点播平台,所以用户如需使用录制功能,需首先自行开通点播服务。
2. 录制文件存放后相关费用(含存储以及下行播放流量)按照点播平台计费方式收取,具体请参考 [对应文档](https://cloud.tencent.com/document/product/266/2838)。
- 模式说明
该接口支持两种录制模式:
1. 定时录制模式【默认模式】。
需要传入开始时间与结束时间,录制任务根据起止时间自动开始与结束。在所设置结束时间过期之前(且未调用StopLiveRecord提前终止任务),录制任务都是有效的,期间多次断流然后重推都会启动录制任务。
2. 实时视频录制模式。
忽略传入的开始时间,在录制任务创建后立即开始录制,录制时长支持最大为30分钟,如果传入的结束时间与当前时间差大于30分钟,则按30分钟计算,实时视频录制主要用于录制精彩视频场景,时长建议控制在5分钟以内。
- 注意事项
1. 调用接口超时设置应大于3秒,小于3秒重试以及按不同起止时间调用都有可能产生重复录制任务,进而导致额外录制费用。
2. 受限于音视频文件格式(FLV/MP4/HLS)对编码类型的支持,视频编码类型支持 H.264,音频编码类型支持 AAC。
3. 为避免恶意或非主观的频繁 API 请求,对定时录制模式最大创建任务数做了限制:其中,当天可以创建的最大任务数不超过4000(不含已删除的任务);当前时刻并发运行的任务数不超过400。有超出此限制的需要提工单申请。
4. 此调用方式暂时不支持海外推流录制。
*/
async CreateLiveRecord(req, cb) {
return this.request("CreateLiveRecord", req, cb);
}
/**
* 更新水印。
*/
async UpdateLiveWatermark(req, cb) {
return this.request("UpdateLiveWatermark", req, cb);
}
/**
* 修改截图模板配置。
*/
async ModifyLiveSnapshotTemplate(req, cb) {
return this.request("ModifyLiveSnapshotTemplate", req, cb);
}
/**
* 查询指定时间段范围内启动和结束的录制任务列表。
- 使用前提
1. 仅用于查询由 CreateRecordTask 接口创建的录制任务。
2. 不能查询被 DeleteRecordTask 接口删除以及已过期(平台侧保留3个月)的录制任务。
*/
async DescribeRecordTask(req, cb) {
return this.request("DescribeRecordTask", req, cb);
}
/**
* 创建水印规则,需要先调用[AddLiveWatermark](/document/product/267/30154)接口添加水印,将返回的水印id绑定到流使用。
*/
async CreateLiveWatermarkRule(req, cb) {
return this.request("CreateLiveWatermarkRule", req, cb);
}
/**
* 用于查询推断流事件。<br>
注意:
1. 该接口提供离线推断流记录查询功能,不可作为重要业务场景强依赖接口。
2. 该接口可通过使用IsFilter进行过滤,返回推流历史记录。
*/
async DescribeLiveStreamEventList(req, cb) {
return this.request("DescribeLiveStreamEventList", req, cb);
}
/**
* 该接口用来创建通用混流。用法与旧接口 mix_streamv2.start_mix_stream_advanced 基本一致。
注意:当前最多支持16路混流。
最佳实践:https://cloud.tencent.com/document/product/267/45566
*/
async CreateCommonMixStream(req, cb) {
return this.request("CreateCommonMixStream", req, cb);
}
/**
* 该接口为监控数据接口,数据采集及统计方式与计费数据不同,仅供运营分析使用,不能用于计费对账参考。
查询某段时间内5分钟粒度的各播放http状态码的个数。
备注:数据延迟1小时,如10:00-10:59点的数据12点才能查到。
*/
async DescribeHttpStatusInfoList(req, cb) {
return this.request("DescribeHttpStatusInfoList", req, cb);
}
/**
* 该接口为监控数据接口,数据采集及统计方式与计费数据不同,仅供运营分析使用,不能用于计费对账参考。
查询某省份某运营商下行播放数据,包括带宽,流量,请求数,并发连接数信息。
*/
async DescribeProvinceIspPlayInfoList(req, cb) {
return this.request("DescribeProvinceIspPlayInfoList", req, cb);
}
/**
* 修改播放域名信息。
*/
async ModifyLivePlayDomain(req, cb) {
return this.request("ModifyLivePlayDomain", req, cb);
}
/**
* 该接口为监控数据接口,数据采集及统计方式与计费数据不同,仅供运营分析使用,不能用于计费对账参考。
查询流id的上行推流质量数据,包括音视频的帧率,码率,流逝时间,编码格式等。
*/
async DescribeStreamPushInfoList(req, cb) {
return this.request("DescribeStreamPushInfoList", req, cb);
}
/**
* 该接口用来启动直播流监播任务。
*/
async StartLiveStreamMonitor(req, cb) {
return this.request("StartLiveStreamMonitor", req, cb);
}
/**
* 获取截图规则列表
*/
async DescribeLiveSnapshotRules(req, cb) {
return this.request("DescribeLiveSnapshotRules", req, cb);
}
/**
* 查询某个时间范围内所有时移流列表。最大支持查询24小时内的数据。
*/
async DescribeTimeShiftStreamList(req, cb) {
return this.request("DescribeTimeShiftStreamList", req, cb);
}
/**
* 删除转码模板。
*/
async DeleteLiveTranscodeTemplate(req, cb) {
return this.request("DeleteLiveTranscodeTemplate", req, cb);
}
/**
* 创建直播垫片模板。
*/
async CreateLivePadTemplate(req, cb) {
return this.request("CreateLivePadTemplate", req, cb);
}
/**
* 获取截图模板列表。
*/
async DescribeLiveSnapshotTemplates(req, cb) {
return this.request("DescribeLiveSnapshotTemplates", req, cb);
}
/**
* 查询直播域名 Referer 黑白名单配置。
由于 Referer 信息包含在 http 协议中,在开启配置后,播放协议为 rtmp 或 WebRTC 不会校验 Referer 配置,仍可正常播放。如需配置 Referer 鉴权建议使用 http-flv 或 http-hls 协议播放。
*/
async DescribeLiveDomainReferer(req, cb) {
return this.request("DescribeLiveDomainReferer", req, cb);
}
/**
* 该接口为监控数据接口,数据采集及统计方式与计费数据不同,仅供运营分析使用,不能用于计费对账参考。
查询某段时间top n客户端ip汇总信息(暂支持top 1000)
*/
async DescribeTopClientIpSumInfoList(req, cb) {
return this.request("DescribeTopClientIpSumInfoList", req, cb);
}
/**
* 修改直播拉流配置的状态。该接口已下线,请使用新接口 ModifyLivePullStreamTask。
*/
async ModifyPullStreamStatus(req, cb) {
return this.request("ModifyPullStreamStatus", req, cb);
}
/**
* 创建一个在指定时间启动、结束的截图任务,并使用指定截图模板ID对应的配置进行截图。
- 注意事项
1. 断流会结束当前截图。在结束时间到达之前任务仍然有效,期间只要正常推流都会正常截图,与是否多次推、断流无关。
2. 使用上避免创建时间段相互重叠的截图任务。若同一条流当前存在多个时段重叠的任务,为避免重复系统将启动最多3个截图任务。
3. 创建的截图任务记录在平台侧只保留3个月。
4. 当前截图任务管理API(CreateScreenshotTask/StopScreenshotTask/DeleteScreenshotTask)与旧API(CreateLiveInstantSnapshot/StopLiveInstantSnapshot)不兼容,两套接口不能混用。
5. 避免 创建截图任务 与 推流 操作同时进行,可能导致因截图任务未生效而引起任务延迟启动问题,两者操作间隔建议大于3秒。
*/
async CreateScreenshotTask(req, cb) {
return this.request("CreateScreenshotTask", req, cb);
}
/**
* 获取录制模板列表。
*/
async DescribeLiveRecordTemplates(req, cb) {
return this.request("DescribeLiveRecordTemplates", req, cb);
}
/**
* 验证用户是否拥有特定直播域名。
*/
async AuthenticateDomainOwner(req, cb) {
return this.request("AuthenticateDomainOwner", req, cb);
}
/**
* 该接口用来修改直播流监播任务的配置。
*/
async ModifyLiveStreamMonitor(req, cb) {
return this.request("ModifyLiveStreamMonitor", req, cb);
}
/**
* 查询某时间段top n的域名或流id信息(暂支持top 1000)。
*/
async DescribeVisitTopSumInfoList(req, cb) {
return this.request("DescribeVisitTopSumInfoList", req, cb);
}
/**
* 修改录制模板配置。
*/
async ModifyLiveRecordTemplate(req, cb) {
return this.request("ModifyLiveRecordTemplate", req, cb);
}
/**
* 获取域名证书信息。
*/
async DescribeLiveDomainCert(req, cb) {
return this.request("DescribeLiveDomainCert", req, cb);
}
/**
* 添加水印,成功返回水印 ID 后,需要调用[CreateLiveWatermarkRule](/document/product/267/32629)接口将水印 ID 绑定到流使用。 水印数量上限 100,超过后需要先删除,再添加。
*/
async AddLiveWatermark(req, cb) {
return this.request("AddLiveWatermark", req, cb);
}
/**
* 海外分区直播播放带宽和流量数据查询。
*/
async DescribeAreaBillBandwidthAndFluxList(req, cb) {
return this.request("DescribeAreaBillBandwidthAndFluxList", req, cb);
}
/**
* 删除水印规则
*/
async DeleteLiveWatermarkRule(req, cb) {
return this.request("DeleteLiveWatermarkRule", req, cb);
}
/**
* 删除直播垫片模板。
*/
async DeleteLivePadTemplate(req, cb) {
return this.request("DeleteLivePadTemplate", req, cb);
}
/**
* 删除回调规则。
*/
async DeleteLiveCallbackRule(req, cb) {
return this.request("DeleteLiveCallbackRule", req, cb);
}
/**
* 更新拉流配置。该接口为已下线接口,请使用新接口 ModifyLivePullStreamTask。
*/
async ModifyPullStreamConfig(req, cb) {
return this.request("ModifyPullStreamConfig", req, cb);
}
/**
* 创建截图模板,数量上限:50,成功返回模板id后,需要调用[CreateLiveSnapshotRule](/document/product/267/32625)接口,将模板id绑定到流使用。
<br>截图相关文档:[直播截图](/document/product/267/32737)。
*/
async CreateLiveSnapshotTemplate(req, cb) {
return this.request("CreateLiveSnapshotTemplate", req, cb);
}
/**
* 返回正在直播中的流列表。适用于推流成功后查询在线流信息。
注意:
1. 该接口仅提供辅助查询在线流列表功能,业务重要场景不可强依赖该接口。
2. 该接口仅适用于流数少于2万路的情况,对于流数较大用户请联系售后。
*/
async DescribeLiveStreamOnlineList(req, cb) {
return this.request("DescribeLiveStreamOnlineList", req, cb);
}
/**
* 启用择优调度。
注意:流维度的择优调度,当主备流结束后自动失效。
*/
async EnableOptimalSwitching(req, cb) {
return this.request("EnableOptimalSwitching", req, cb);
}
/**
* 删除回调模板。
*/
async DeleteLiveCallbackTemplate(req, cb) {
return this.request("DeleteLiveCallbackTemplate", req, cb);
}
/**
* 查询直播推流鉴权key
*/
async DescribeLivePushAuthKey(req, cb) {
return this.request("DescribeLivePushAuthKey", req, cb);
}
/**
* 删除直播拉流配置。该接口已下线,请使用新接口 DeleteLivePullStreamTask。
*/
async DeletePullStreamConfig(req, cb) {
return this.request("DeletePullStreamConfig", req, cb);
}
/**
* 前提调用 DescribeTimeShiftStreamList 获得请求必要参数。查询指定范围内的时移流录制详情,最大支持24小时范围查询。
*/
async DescribeTimeShiftRecordDetail(req, cb) {
return this.request("DescribeTimeShiftRecordDetail", req, cb);
}
/**
* 获取单个录制模板。
*/
async DescribeLiveRecordTemplate(req, cb) {
return this.request("DescribeLiveRecordTemplate", req, cb);
}
/**
* 获取单个转码模板。
*/
async DescribeLiveTranscodeTemplate(req, cb) {
return this.request("DescribeLiveTranscodeTemplate", req, cb);
}
/**
* 提前结束截图,中止运行中的截图任务。任务被成功终止后,本次任务将不再启动。
*/
async StopScreenshotTask(req, cb) {
return this.request("StopScreenshotTask", req, cb);
}
/**
* 用来查询监播场次7天内的智能识别、断流、低帧率等信息的汇总报告。
*/
async DescribeMonitorReport(req, cb) {
return this.request("DescribeMonitorReport", req, cb);
}
/**
* 查询直播拉流配置。该接口已下线,请使用新接口 DescribeLivePullStreamTasks。
*/
async DescribePullStreamConfigs(req, cb) {
return this.request("DescribePullStreamConfigs", req, cb);
}
/**
* 该接口用来查询某个特定监播任务的配置。
*/
async DescribeLiveStreamMonitor(req, cb) {
return this.request("DescribeLiveStreamMonitor", req, cb);
}
/**
* 删除水印。
*/
async DeleteLiveWatermark(req, cb) {
return this.request("DeleteLiveWatermark", req, cb);
}
/**
* 查询绑定证书的域名列表。
*/
async DescribeLiveDomainCertBindings(req, cb) {
return this.request("DescribeLiveDomainCertBindings", req, cb);
}
/**
* 该接口为监控数据接口,数据采集及统计方式与计费数据不同,仅供运营分析使用,不能用于计费对账参考。
查询下行播放错误码信息。
*/
async DescribePlayErrorCodeSumInfoList(req, cb) {
return this.request("DescribePlayErrorCodeSumInfoList", req, cb);
}
/**
* 针对大型活动直播,通过对直播流设置延时来控制现场与观众播放画面的时间间隔,避免突发状况造成影响。
注意:如果在推流前设置延播,需要提前5分钟设置,目前该接口只支持流粒度。
*/
async AddDelayLiveStream(req, cb) {
return this.request("AddDelayLiveStream", req, cb);
}
/**
* 直播上行路数查询。
*/
async DescribeUploadStreamNums(req, cb) {
return this.request("DescribeUploadStreamNums", req, cb);
}
/**
* 该接口为监控数据接口,数据采集及统计方式与计费数据不同,仅供运营分析使用,不能用于计费对账参考。
查询天维度每条流的播放数据,包括总流量等。
*/
async DescribeStreamDayPlayInfoList(req, cb) {
return this.request("DescribeStreamDayPlayInfoList", req, cb);
}
/**
* 修改直播推流鉴权key
*/
async ModifyLivePushAuthKey(req, cb) {
return this.request("ModifyLivePushAuthKey", req, cb);
}
/**
* 修改转码模板配置。
*/
async ModifyLiveTranscodeTemplate(req, cb) {
return this.request("ModifyLiveTranscodeTemplate", req, cb);
}
/**
* 删除转码规则。
DomainName+AppName+StreamName+TemplateId唯一标识单个转码规则,如需删除需要强匹配。其中TemplateId必填,其余参数为空时也需要传空字符串进行强匹配。
*/
async DeleteLiveTranscodeRule(req, cb) {
return this.request("DeleteLiveTranscodeRule", req, cb);
}
/**
* 查询转码总量数据,可查询近三个月内的数据。
注意:
如果是查询某一天内,则返回5分钟粒度数据;
如果是查询跨天或指定域名, 则返回1小时粒度数据。
*/
async DescribeLiveTranscodeTotalInfo(req, cb) {
return this.request("DescribeLiveTranscodeTotalInfo", req, cb);
}
/**
* 删除截图规则。
*/
async DeleteLiveSnapshotRule(req, cb) {
return this.request("DeleteLiveSnapshotRule", req, cb);
}
/**
* 删除接口 CreateLivePullStreamTask 创建的拉流任务。
注意:
1. 入参中的 TaskId 为 CreateLivePullStreamTask 接口创建时返回的TaskId。
2. 也可通过 DescribeLivePullStreamTasks 进行查询创建的任务。
*/
async DeleteLivePullStreamTask(req, cb) {
return this.request("DeleteLivePullStreamTask", req, cb);
}
/**
* 获取禁推流列表。
注意:该接口仅作为直播辅助查询接口,重要业务场景不可强依赖该接口。
*/
async DescribeLiveForbidStreamList(req, cb) {
return this.request("DescribeLiveForbidStreamList", req, cb);
}
/**
* 修改直播垫片模板。
*/
async ModifyLivePadTemplate(req, cb) {
return this.request("ModifyLivePadTemplate", req, cb);
}
/**
* 获取单个水印信息。
*/
async DescribeLiveWatermark(req, cb) {
return this.request("DescribeLiveWatermark", req, cb);
}
/**
* 获取证书信息
*/
async DescribeLiveCert(req, cb) {
return this.request("DescribeLiveCert", req, cb);
}
/**
* 批量绑定证书对应的播放域名,并更新启用状态。
新建自有证书将自动上传至腾讯云ssl。
*/
async ModifyLiveDomainCertBindings(req, cb) {
return this.request("ModifyLiveDomainCertBindings", req, cb);
}
/**
* 批量获取转推日志的URL。
*/
async DescribeDeliverLogDownList(req, cb) {
return this.request("DescribeDeliverLogDownList", req, cb);
}
/**
* 根据域名状态、类型等信息查询用户的域名信息。
*/
async DescribeLiveDomains(req, cb) {
return this.request("DescribeLiveDomains", req, cb);
}
/**
* 更新直播拉流任务。
1. 不支持修改拉流源类型,如需更换,请创建新任务。
*/
async ModifyLivePullStreamTask(req, cb) {
return this.request("ModifyLivePullStreamTask", req, cb);
}
/**
* 查询拉流转推任务的时长信息。
*/
async DescribePullTransformPushInfo(req, cb) {
return this.request("DescribePullTransformPushInfo", req, cb);
}
/**
* 创建回调模板,数量上限:50,成功返回模板id后,需要调用[CreateLiveCallbackRule](/document/product/267/32638)接口将模板 ID 绑定到域名/路径使用。
<br>回调协议相关文档:[事件消息通知](/document/product/267/32744)。
注意:至少填写一个回调 URL。
*/
async CreateLiveCallbackTemplate(req, cb) {
return this.request("CreateLiveCallbackTemplate", req, cb);
}
/**
* 恢复某条流的推流。
*/
async ResumeLiveStream(req, cb) {
return this.request("ResumeLiveStream", req, cb);
}
/**
* 获取单个回调模板。
*/
async DescribeLiveCallbackTemplate(req, cb) {
return this.request("DescribeLiveCallbackTemplate", req, cb);
}
/**
* 删除已添加的直播域名
*/
async DeleteLiveDomain(req, cb) {
return this.request("DeleteLiveDomain", req, cb);
}
/**
* 修改回调模板。
*/
async ModifyLiveCallbackTemplate(req, cb) {
return this.request("ModifyLiveCallbackTemplate", req, cb);
}
/**
* 查询使用 CreateLivePullStreamTask 接口创建的直播拉流任务。
排序方式:默认按更新时间 倒序排列。
*/
async DescribeLivePullStreamTasks(req, cb) {
return this.request("DescribeLivePullStreamTasks", req, cb);
}
/**
* 该接口为监控数据接口,数据采集及统计方式与计费数据不同,仅供运营分析使用,不能用于计费对账参考。
查询按省份和运营商分组的下行播放数据。
*/
async DescribeGroupProIspPlayInfoList(req, cb) {
return this.request("DescribeGroupProIspPlayInfoList", req, cb);
}
/**
* 该接口为监控数据接口,数据采集及统计方式与计费数据不同,仅供运营分析使用,不能用于计费对账参考。
查询播放数据,支持按流名称查询详细播放数据,也可按播放域名查询详细总数据,数据延迟4分钟左右。
*/
async DescribeStreamPlayInfoList(req, cb) {
return this.request("DescribeStreamPlayInfoList", req, cb);
}
/**
* 查询直播拉流任务状态信息。
*/
async DescribeLivePullStreamTaskStatus(req, cb) {
return this.request("DescribeLivePullStreamTaskStatus", req, cb);
}
/**
* 获取单个截图模板。
*/
async DescribeLiveSnapshotTemplate(req, cb) {
return this.request("DescribeLiveSnapshotTemplate", req, cb);
}
/**
* 获取回调模板列表
*/
async DescribeLiveCallbackTemplates(req, cb) {
return this.request("DescribeLiveCallbackTemplates", req, cb);
}
/**
* 提前结束录制,中止运行中的录制任务并生成录制文件。任务被成功终止后,本次任务将不再启动。
*/
async StopRecordTask(req, cb) {
return this.request("StopRecordTask", req, cb);
}
/**
* 修改直播时移模板。
*/
async ModifyLiveTimeShiftTemplate(req, cb) {
return this.request("ModifyLiveTimeShiftTemplate", req, cb);
}
/**
* 该接口用来创建直播流监播任务。
*/
async CreateLiveStreamMonitor(req, cb) {
return this.request("CreateLiveStreamMonitor", req, cb);
}
/**
* 创建直播垫片规则。
*/
async CreateLivePadRule(req, cb) {
return this.request("CreateLivePadRule", req, cb);
}
/**
* 说明:录制后的文件存放于点播平台。用户如需使用录制功能,需首先自行开通点播账号并确保账号可用。录制文件存放后,相关费用(含存储以及下行播放流量)按照点播平台计费方式收取,请参考对应文档。
*/
async StopLiveRecord(req, cb) {
return this.request("StopLiveRecord", req, cb);
}
/**
* 修改播放鉴权key
*/
async ModifyLivePlayAuthKey(req, cb) {
return this.request("ModifyLivePlayAuthKey", req, cb);
}
/**
* 获取单个直播垫片模板
*/
async DescribeLivePadTemplate(req, cb) {
return this.request("DescribeLivePadTemplate", req, cb);
}
/**
* 接口用来查询直播增值业务--截图的张数
*/
async DescribeScreenShotSheetNumList(req, cb) {
return this.request("DescribeScreenShotSheetNumList", req, cb);
}
/**
* 解绑域名证书
*/
async UnBindLiveDomainCert(req, cb) {
return this.request("UnBindLiveDomainCert", req, cb);
}
/**
* 删除录制任务配置。删除操作不影响正在运行当中的任务,仅对删除之后新的推流有效。
*/
async DeleteRecordTask(req, cb) {
return this.request("DeleteRecordTask", req, cb);
}
/**
* 该接口为监控数据接口,数据采集及统计方式与计费数据不同,仅供运营分析使用,不能用于计费对账参考。
支持查询某天或某段时间的转码详细信息。由于转码数据量较大,如果查询时间跨度太长可能会拉不到数据,可以尝试将查询时间范围缩小些再重试。
*/
async DescribeLiveTranscodeDetailInfo(req, cb) {
return this.request("DescribeLiveTranscodeDetailInfo", req, cb);
}
/**
* 批量获取日志URL。
*/
async DescribeLogDownloadList(req, cb) {
return this.request("DescribeLogDownloadList", req, cb);
}
/**
* 获取录制规则列表
*/
async DescribeLiveRecordRules(req, cb) {
return this.request("DescribeLiveRecordRules", req, cb);
}
/**
* 获取直播时移模板。
*/
async DescribeLiveTimeShiftTemplates(req, cb) {
return this.request("DescribeLiveTimeShiftTemplates", req, cb);
}
/**
* P2P流数据查询接口,用来获取流量、卡播和起播信息。
*/
async DescribeLiveXP2PDetailInfoList(req, cb) {
return this.request("DescribeLiveXP2PDetailInfoList", req, cb);
}
/**
* 获取直播延播列表。
*/
async DescribeLiveDelayInfoList(req, cb) {
return this.request("DescribeLiveDelayInfoList", req, cb);
}
/**
* 获取直播时移规则列表。
*/
async DescribeLiveTimeShiftRules(req, cb) {
return this.request("DescribeLiveTimeShiftRules", req, cb);
}
/**
* 删除录制规则。
*/
async DeleteLiveRecordRule(req, cb) {
return this.request("DeleteLiveRecordRule", req, cb);
}
/**
* 查询直播域名信息。
*/
async DescribeLiveDomain(req, cb) {
return this.request("DescribeLiveDomain", req, cb);
}
/**
* 删除直播垫片规则。
*/
async DeleteLivePadRule(req, cb) {
return this.request("DeleteLivePadRule", req, cb);
}
/**
* 创建回调规则,需要先调用[CreateLiveCallbackTemplate](/document/product/267/32637)接口创建回调模板,将返回的模板id绑定到域名/路径进行使用。
<br>回调协议相关文档:[事件消息通知](/document/product/267/32744)。
*/
async CreateLiveCallbackRule(req, cb) {
return this.request("CreateLiveCallbackRule", req, cb);
}
/**
* 获取回调规则列表
*/
async DescribeLiveCallbackRules(req, cb) {
return this.request("DescribeLiveCallbackRules", req, cb);
}
/**
* 该接口为监控数据接口,数据采集及统计方式与计费数据不同,仅供运营分析使用,不能用于计费对账参考。
查询下行播放错误码信息,某段时间内1分钟粒度的各http错误码出现的次数,包括4xx,5xx。
*/
async DescribePlayErrorCodeDetailInfoList(req, cb) {
return this.request("DescribePlayErrorCodeDetailInfoList", req, cb);
}
/**
* 提供给客户对账,按天统计,维度:推流域名、时移文件时长(累加)、配置天数(不累加)、时移总时长(累加)。
*/
async DescribeLiveTimeShiftBillInfoList(req, cb) {
return this.request("DescribeLiveTimeShiftBillInfoList", req, cb);
}
/**
* 返回已经推过流的流列表。<br>
注意:分页最多支持查询1万条记录,可通过调整查询时间范围来获取更多数据。
*/
async DescribeLiveStreamPublishedList(req, cb) {
return this.request("DescribeLiveStreamPublishedList", req, cb);
}
/**
* 查询指定时间段范围内启动和结束的截图任务列表。
- 使用前提
1. 仅用于查询由 CreateScreenshotTask接口创建的截图任务。
2. 不能查询被 DeleteScreenshotTask接口删除以及已过期(平台侧保留3个月)的截图任务。
*/
async DescribeScreenshotTask(req, cb) {
return this.request("DescribeScreenshotTask", req, cb);
}
/**
* 使用该接口查询垫片流。垫片流状态更新存在一定延迟,可间隔30秒以上查询,避免频繁查询该接口。
*/
async DescribeLivePadProcessorList(req, cb) {
return this.request("DescribeLivePadProcessorList", req, cb);
}
/**
* 直播推流带宽和流量数据查询。
推流计费会先取全球推流用量和全球播放用量进行比较,满足计费条件后再按各地区用量出账。详情参见[计费文档](https://cloud.tencent.com/document/product/267/34175)。
*/
async DescribePushBandwidthAndFluxList(req, cb) {
return this.request("DescribePushBandwidthAndFluxList", req, cb);
}
/**
* 删除截图任务配置。删除操作不影响正在运行当中的任务,仅对删除之后新的推流有效。
*/
async DeleteScreenshotTask(req, cb) {
return this.request("DeleteScreenshotTask", req, cb);
}
/**
* 禁止某条流的推送,可以预设某个时刻将流恢复。
注意:
1. 默认只要流名称正确,禁推就会生效。
2. 如需要推流域名+推流路径+流名称 强匹配生效禁推,需提单联系售后开启配置。
3. 如果配置了域名分组,需填写准确推流域名,才可断掉当前推流。
*/
async ForbidLiveStream(req, cb) {
return this.request("ForbidLiveStream", req, cb);
}
/**
* 添加域名,一次只能提交一个域名。域名必须已备案。
*/
async AddLiveDomain(req, cb) {
return this.request("AddLiveDomain", req, cb);
}
/**
* 查询直播转推计费带宽,查询时间范围最大支持3个月内的数据,时间跨度最长31天。
*/
async DescribeDeliverBandwidthList(req, cb) {
return this.request("DescribeDeliverBandwidthList", req, cb);
}
/**
* 调用该接口实现切换当前播放所使用的主备流。
*/
async SwitchBackupStream(req, cb) {
return this.request("SwitchBackupStream", req, cb);
}
/**
* 该接口为监控数据接口,数据采集及统计方式与计费数据不同,仅供运营分析使用,不能用于计费对账参考。
查询实时的域名维度下行播放数据,由于数据处理有耗时,接口默认查询4分钟前的准实时数据。
*/
async DescribeLiveDomainPlayInfoList(req, cb) {
return this.request("DescribeLiveDomainPlayInfoList", req, cb);
}
/**
* 创建直播时移规则,需要先调用[CreateLiveTimeShiftTemplate](/document/product/267/86169)接口创建直播时移模板,将返回的模板id绑定到流使用。
<br>直播时移相关文档:[直播时移](/document/product/267/86134)。
*/
async CreateLiveTimeShiftRule(req, cb) {
return this.request("CreateLiveTimeShiftRule", req, cb);
}
/**
* 该接口为监控数据接口,数据采集及统计方式与计费数据不同,仅供运营分析使用,不能用于计费对账参考。
用于查询回调事件。
*/
async DescribeCallbackRecordsList(req, cb) {
return this.request("DescribeCallbackRecordsList", req, cb);
}
/**
* 创建录制规则,需要先调用[CreateLiveRecordTemplate](/document/product/267/32614)接口创建录制模板,将返回的模板id绑定到流使用。
<br>录制相关文档:[直播录制](/document/product/267/32739)。
*/
async CreateLiveRecordRule(req, cb) {
return this.request("CreateLiveRecordRule", req, cb);
}
/**
* 创建直播拉流任务。支持将外部已有的点播文件,或者直播源拉取过来转推到指定的目标地址。
注意:
1. 默认支持任务数上限200个,如有特殊需求,可通过提单到售后进行评估增加上限。
2. 源流视频编码目前只支持: H264, H265。其他编码格式建议先进行转码处理。
3. 源流音频编码目前只支持: AAC。其他编码格式建议先进行转码处理。
4. 可在控制台开启过期自动清理,避免过期任务占用任务数额度。
5. 拉流转推功能为计费增值服务,计费规则详情可参见[计费文档](https://cloud.tencent.com/document/product/267/53308)。
6. 拉流转推功能仅提供内容拉取与推送服务,请确保内容已获得授权并符合内容传播相关的法律法规。若内容有侵权或违规相关问题,云直播会停止相关的功能服务并保留追究法律责任的权利。
*/
async CreateLivePullStreamTask(req, cb) {
return this.request("CreateLivePullStreamTask", req, cb);
}
/**
* 获取转码模板列表。
*/
async DescribeLiveTranscodeTemplates(req, cb) {
return this.request("DescribeLiveTranscodeTemplates", req, cb);
}
/**
* 创建录制模板,数量上限:50,成功返回模板id后,需要调用[CreateLiveRecordRule](/document/product/267/32615)接口,将模板id绑定到流进行使用。
<br>录制相关文档:[直播录制](/document/product/267/32739)。
*/
async CreateLiveRecordTemplate(req, cb) {
return this.request("CreateLiveRecordTemplate", req, cb);
}
/**
* 直播播放带宽和流量数据查询。
*/
async DescribeBillBandwidthAndFluxList(req, cb) {
return this.request("DescribeBillBandwidthAndFluxList", req, cb);
}
/**
* 停止使用某个直播域名。
*/
async ForbidLiveDomain(req, cb) {
return this.request("ForbidLiveDomain", req, cb);
}
/**
* 创建转码规则,数量上限:50,需要先调用[CreateLiveTranscodeTemplate](/document/product/267/32646)接口创建转码模板,将返回的模板id绑定到流使用。
<br>转码相关文档:[直播转封装及转码](/document/product/267/32736)。
*/
async CreateLiveTranscodeRule(req, cb) {
return this.request("CreateLiveTranscodeRule", req, cb);
}
/**
* 删除直播时移规则。
*/
async DeleteLiveTimeShiftRule(req, cb) {
return this.request("DeleteLiveTimeShiftRule", req, cb);
}
/**
* 将正在运行的拉流转推任务进行重启。
注意:
1. 重启任务会造成推流中断。
2. 点播源任务的重启,会根据VodRefreshType决定是续播还是从头开始播。
*/
async RestartLivePullStreamTask(req, cb) {
return this.request("RestartLivePullStreamTask", req, cb);
}
/**
* 创建临时拉流转推任务,目前限制添加10条任务。
该接口已下线,请使用新接口 CreateLivePullStreamTask。
注意:该接口用于创建临时拉流转推任务,
拉流源地址即 FromUrl 可以是腾讯或非腾讯数据源,
但转推目标地址即 ToUrl 目前限制为已注册的腾讯直播域名。
*/
async CreatePullStreamConfig(req, cb) {
return this.request("CreatePullStreamConfig", req, cb);
}
/**
* 获取水印规则列表。
*/
async DescribeLiveWatermarkRules(req, cb) {
return this.request("DescribeLiveWatermarkRules", req, cb);
}
/**
* 获取直播垫片规则列表。
*/
async DescribeLivePadRules(req, cb) {
return this.request("DescribeLivePadRules", req, cb);
}
/**
* 注:DeleteLiveRecord 接口仅用于删除录制任务记录,不具备停止录制的功能,也不能删除正在进行中的录制。如果需要停止录制任务,请使用终止录制[StopLiveRecord](/document/product/267/30146) 接口。
*/
async DeleteLiveRecord(req, cb) {
return this.request("DeleteLiveRecord", req, cb);
}
/**
* 该接口用来查询直播流监播任务配置的列表信息。
*/
async DescribeLiveStreamMonitorList(req, cb) {
return this.request("DescribeLiveStreamMonitorList", req, cb);
}
/**
* 创建截图规则,需要先调用[CreateLiveSnapshotTemplate](/document/product/267/32624)接口创建截图模板,然后将返回的模板 ID 绑定到流进行使用。
<br>截图相关文档:[直播截图](/document/product/267/32737)。
注意:单个域名仅支持关联一个截图模板。
*/
async CreateLiveSnapshotRule(req, cb) {
return this.request("CreateLiveSnapshotRule", req, cb);
}
/**
* 创建直播时移模板。
*/
async CreateLiveTimeShiftTemplate(req, cb) {
return this.request("CreateLiveTimeShiftTemplate", req, cb);
}
/**
* 该接口用来删除直播流监播任务。
*/
async DeleteLiveStreamMonitor(req, cb) {
return this.request("DeleteLiveStreamMonitor", req, cb);
}
/**
* 删除直播时移模板。
*/
async DeleteLiveTimeShiftTemplate(req, cb) {
return this.request("DeleteLiveTimeShiftTemplate", req, cb);
}
/**
* 该接口为监控数据接口,数据采集及统计方式与计费数据不同,仅供运营分析使用,不能用于计费对账参考。
查询某段时间内每个国家地区每个省份每个运营商的平均每秒流量,总流量,总请求数信息。
*/
async DescribeProIspPlaySumInfoList(req, cb) {
return this.request("DescribeProIspPlaySumInfoList", req, cb);
}
/**
* 该接口为监控数据接口,数据采集及统计方式与计费数据不同,仅供运营分析使用,不能用于计费对账参考。
输入某个时间点(1分钟维度),查询该时间点所有流的下行信息。
*/
async DescribeAllStreamPlayInfoList(req, cb) {
return this.request("DescribeAllStreamPlayInfoList", req, cb);
}
/**
* 查询播放鉴权key。
*/
async DescribeLivePlayAuthKey(req, cb) {
return this.request("DescribeLivePlayAuthKey", req, cb);
}
/**
* 该接口用来停止直播流监播任务。
*/
async StopLiveStreamMonitor(req, cb) {
return this.request("StopLiveStreamMonitor", req, cb);
}
/**
* 返回直播中、无推流或者禁播等状态。
使用建议:
该接口提供实时流状态查询功能,鉴于网络抖动等一些不可抗因素,使用该接口作为判断主播是否开播等重要业务场景时,请参考以下使用建议。
1. 优先使用业务自身的房间开关播逻辑,判断主播是否在线,譬如客户端开播信令和主播在线心跳等。
2. 对于没有房间管理的直播场景,可以结合以下方案综合判断。
2.1 根据[推断流事件通知](/document/product/267/20388) 判断主播在线状态。
2.2 通过定时(间隔>1min)查询[直播中的流接口](/document/api/267/20472),判断主播是否在线。
2.3 通过 本接口 查询直播流状态,判断主播是否在线。
2.4 以上任一方式判断为在线,都认为主播开播中,并且接口查询超时或解析异常时,也默认为在线,减少对业务的影响。
*/
async DescribeLiveStreamState(req, cb) {
return this.request("DescribeLiveStreamState", req, cb);
}
/**
* 设置直播域名 Referer 黑白名单。
由于 Referer 信息包含在 http 协议中,在开启配置后,播放协议为 rtmp 或 WebRTC 不会校验 Referer 配置,仍可正常播放。如需配置 Referer 鉴权建议使用 http-flv 或 http-hls 协议播放。
*/
async ModifyLiveDomainReferer(req, cb) {
return this.request("ModifyLiveDomainReferer", req, cb);
}
/**
* 删除录制模板。
*/
async DeleteLiveRecordTemplate(req, cb) {
return this.request("DeleteLiveRecordTemplate", req, cb);
}
/**
* 返回正在直播中的流列表。适用于推流成功后查询在线流信息。
注意:
1. 该接口仅提供辅助查询在线流列表功能,业务重要场景不可强依赖该接口。
2. 该接口仅适用于流数少于2万路的情况,对于流数较大用户请联系售后。
*/