@@ -3646,3 +3646,85 @@ func TestCIService_CreateGeneratePlayListJob(t *testing.T) {
36463646 t .Fatalf ("CI.CreateGeneratePlayListJob returned error: %v" , err )
36473647 }
36483648}
3649+
3650+ func TestCIService_CreateMultiGeneratePlayListJobs (t * testing.T ) {
3651+ setup ()
3652+ defer teardown ()
3653+
3654+ mux .HandleFunc ("/jobs" , func (w http.ResponseWriter , r * http.Request ) {
3655+ testMethod (t , r , http .MethodPost )
3656+ testHeader (t , r , "Content-Type" , "application/xml" )
3657+ })
3658+
3659+ opt := & CreateMultiGeneratePlayListJobsOptions {
3660+ Input : & JobInput {
3661+ Object : "test.mp4" ,
3662+ },
3663+ Operation : []GeneratePlayListJobOperation {
3664+ {
3665+ Tag : "GeneratePlayList" ,
3666+ Output : & JobOutput {
3667+ Region : "ap-beijing" ,
3668+ Bucket : "abc-1250000000" ,
3669+ Object : "live/a.m3u8" ,
3670+ },
3671+ Transcode : & LiveTanscode {
3672+ Video : & LiveTanscodeVideo {
3673+ Codec : "H.264" ,
3674+ Width : "960" , // 设置480、720、960、1080
3675+ Bitrate : "2000" ,
3676+ Maxrate : "5000" ,
3677+ Fps : "30" ,
3678+ },
3679+ Container : & Container {
3680+ Format : "hls" ,
3681+ ClipConfig : & ClipConfig {
3682+ Duration : "5" ,
3683+ },
3684+ },
3685+ TransConfig : & LiveTanscodeTransConfig {
3686+ HlsEncrypt : & HlsEncrypt {
3687+ IsHlsEncrypt : true ,
3688+ },
3689+ InitialClipNum : "2" ,
3690+ CosTag : "a=a&b=b" ,
3691+ },
3692+ },
3693+ },
3694+ {
3695+ Tag : "GeneratePlayList" ,
3696+ Output : & JobOutput {
3697+ Region : "ap-beijing" ,
3698+ Bucket : "abc-1250000000" ,
3699+ Object : "live/b.m3u8" ,
3700+ },
3701+ Transcode : & LiveTanscode {
3702+ Video : & LiveTanscodeVideo {
3703+ Codec : "H.264" ,
3704+ Width : "1080" , // 设置480、720、960、1080
3705+ Bitrate : "2000" ,
3706+ Maxrate : "5000" ,
3707+ Fps : "30" ,
3708+ },
3709+ Container : & Container {
3710+ Format : "hls" ,
3711+ ClipConfig : & ClipConfig {
3712+ Duration : "5" ,
3713+ },
3714+ },
3715+ TransConfig : & LiveTanscodeTransConfig {
3716+ InitialClipNum : "2" ,
3717+ CosTag : "a=a&b=b" ,
3718+ },
3719+ },
3720+ },
3721+ },
3722+ QueueId : "p893bcda225bf4945a378da6662e81a89" ,
3723+ CallBack : "https://www.callback.com" ,
3724+ }
3725+
3726+ _ , _ , err := client .CI .CreateMultiGeneratePlayListJobs (context .Background (), opt )
3727+ if err != nil {
3728+ t .Fatalf ("CI.CreateMultiGeneratePlayListJobs returned errors: %v" , err )
3729+ }
3730+ }
0 commit comments