@@ -24,7 +24,7 @@ func (s *Scenario) RunRecording(token string, storageConfig *cloudRecordingAPI.S
24
24
ctx := context .Background ()
25
25
26
26
// acquire
27
- acquireResp , err := s .CloudRecordingClient .IndividualRecording ().Acquire (ctx , s .Cname , s .Uid , false , & req.AcquireIndividualRecordingClientRequest {})
27
+ acquireResp , err := s .CloudRecordingClient .IndividualRecording ().Acquire (ctx , s .Cname , s .Uid , & req.AcquireIndividualRecordingClientRequest {})
28
28
if err != nil {
29
29
log .Println (err )
30
30
return
@@ -148,7 +148,7 @@ func (s *Scenario) RunSnapshot(token string, storageConfig *cloudRecordingAPI.St
148
148
ctx := context .Background ()
149
149
150
150
// acquire
151
- acquireResp , err := s .CloudRecordingClient .IndividualRecording ().Acquire (ctx , s .Cname , s .Uid , false , & req.AcquireIndividualRecordingClientRequest {})
151
+ acquireResp , err := s .CloudRecordingClient .IndividualRecording ().Acquire (ctx , s .Cname , s .Uid , & req.AcquireIndividualRecordingClientRequest {})
152
152
if err != nil {
153
153
log .Println (err )
154
154
return
@@ -271,7 +271,7 @@ func (s *Scenario) RunSnapshot(token string, storageConfig *cloudRecordingAPI.St
271
271
func (s * Scenario ) RunRecordingAndSnapshot (token string , storageConfig * cloudRecordingAPI.StorageConfig ) {
272
272
ctx := context .Background ()
273
273
// acquire
274
- acquireResp , err := s .CloudRecordingClient .IndividualRecording ().Acquire (ctx , s .Cname , s .Uid , false , & req.AcquireIndividualRecordingClientRequest {})
274
+ acquireResp , err := s .CloudRecordingClient .IndividualRecording ().Acquire (ctx , s .Cname , s .Uid , & req.AcquireIndividualRecordingClientRequest {})
275
275
if err != nil {
276
276
log .Println (err )
277
277
return
@@ -395,273 +395,3 @@ func (s *Scenario) RunRecordingAndSnapshot(token string, storageConfig *cloudRec
395
395
time .Sleep (time .Second * 10 )
396
396
}
397
397
}
398
-
399
- func (s * Scenario ) RunRecordingAndPostponeTranscoding (token string , storageConfig * cloudRecordingAPI.StorageConfig ) {
400
- ctx := context .Background ()
401
-
402
- // acquire
403
- acquireResp , err := s .CloudRecordingClient .IndividualRecording ().Acquire (ctx , s .Cname , s .Uid , true , & req.AcquireIndividualRecordingClientRequest {})
404
- if err != nil {
405
- log .Println (err )
406
- return
407
- }
408
- if acquireResp .IsSuccess () {
409
- log .Printf ("acquire success:%+v\n " , acquireResp )
410
- } else {
411
- log .Printf ("acquire failed:%+v\n " , acquireResp )
412
- return
413
- }
414
-
415
- resourceId := acquireResp .SuccessRes .ResourceId
416
- // start
417
- startResp , err := s .CloudRecordingClient .IndividualRecording ().Start (ctx , resourceId , s .Cname , s .Uid , & req.StartIndividualRecordingClientRequest {
418
- Token : token ,
419
- RecordingConfig : & cloudRecordingAPI.RecordingConfig {
420
- ChannelType : 1 ,
421
- StreamTypes : 2 ,
422
- MaxIdleTime : 30 ,
423
- SubscribeAudioUIDs : []string {
424
- "#allstream#" ,
425
- },
426
- SubscribeVideoUIDs : []string {
427
- "#allstream#" ,
428
- },
429
- SubscribeUidGroup : 0 ,
430
- },
431
- RecordingFileConfig : & cloudRecordingAPI.RecordingFileConfig {
432
- AvFileType : []string {
433
- "hls" ,
434
- },
435
- },
436
- StorageConfig : storageConfig ,
437
- AppsCollection : & cloudRecordingAPI.AppsCollection {
438
- CombinationPolicy : "postpone_transcoding" ,
439
- },
440
- TranscodeOptions : & cloudRecordingAPI.TranscodeOptions {
441
- Container : & cloudRecordingAPI.Container {
442
- Format : "mp4" ,
443
- },
444
- TransConfig : & cloudRecordingAPI.TransConfig {
445
- TransMode : "postponeTranscoding" ,
446
- },
447
- },
448
- })
449
- if err != nil {
450
- log .Println (err )
451
- return
452
- }
453
- if startResp .IsSuccess () {
454
- log .Printf ("start success:%+v\n " , startResp )
455
- } else {
456
- log .Printf ("start failed:%+v\n " , startResp )
457
- return
458
- }
459
-
460
- sid := startResp .SuccessResponse .Sid
461
- // stop
462
- defer func () {
463
- stopResp , err := s .CloudRecordingClient .IndividualRecording ().Stop (ctx , resourceId , sid , s .Cname , s .Uid , false )
464
- if err != nil {
465
- log .Println (err )
466
- return
467
- }
468
- if stopResp .IsSuccess () {
469
- log .Printf ("stop success:%+v\n " , stopResp )
470
- } else {
471
- log .Printf ("stop failed:%+v\n " , stopResp )
472
- return
473
- }
474
- }()
475
-
476
- // query
477
- for i := 0 ; i < 3 ; i ++ {
478
- queryResp , err := s .CloudRecordingClient .IndividualRecording ().Query (ctx , resourceId , sid )
479
- if err != nil {
480
- log .Println (err )
481
- return
482
- }
483
- if queryResp .IsSuccess () {
484
- log .Printf ("query success:%+v\n " , queryResp )
485
- } else {
486
- log .Printf ("query failed:%+v\n " , queryResp )
487
- return
488
- }
489
- time .Sleep (time .Second * 10 )
490
- }
491
-
492
- // update
493
- updateResp , err := s .CloudRecordingClient .IndividualRecording ().Update (ctx , resourceId , sid , s .Cname , s .Uid , & req.UpdateIndividualRecordingClientRequest {
494
- StreamSubscribe : & cloudRecordingAPI.UpdateStreamSubscribe {
495
- AudioUidList : & cloudRecordingAPI.UpdateAudioUIDList {
496
- SubscribeAudioUIDs : []string {
497
- "#allstream#" ,
498
- },
499
- },
500
- VideoUidList : & cloudRecordingAPI.UpdateVideoUIDList {
501
- SubscribeVideoUIDs : []string {
502
- "#allstream#" ,
503
- },
504
- },
505
- },
506
- })
507
- if err != nil {
508
- log .Println (err )
509
- return
510
- }
511
- if updateResp .IsSuccess () {
512
- log .Printf ("update success:%+v\n " , updateResp )
513
- } else {
514
- log .Printf ("update failed:%+v\n " , updateResp )
515
- return
516
- }
517
-
518
- // query
519
- for i := 0 ; i < 3 ; i ++ {
520
- queryResp , err := s .CloudRecordingClient .IndividualRecording ().Query (ctx , resourceId , sid )
521
- if err != nil {
522
- log .Println (err )
523
- return
524
- }
525
- if queryResp .IsSuccess () {
526
- log .Printf ("query success:%+v\n " , queryResp )
527
- } else {
528
- log .Printf ("query failed:%+v\n " , queryResp )
529
- return
530
- }
531
- time .Sleep (time .Second * 10 )
532
- }
533
- }
534
-
535
- func (s * Scenario ) RunRecordingAndAudioMix (token string , storageConfig * cloudRecordingAPI.StorageConfig ) {
536
- ctx := context .Background ()
537
-
538
- // acquire
539
- acquireResp , err := s .CloudRecordingClient .IndividualRecording ().Acquire (ctx , s .Cname , s .Uid , true , & req.AcquireIndividualRecordingClientRequest {})
540
- if err != nil {
541
- log .Println (err )
542
- return
543
- }
544
- if acquireResp .IsSuccess () {
545
- log .Printf ("acquire success:%+v\n " , acquireResp )
546
- } else {
547
- log .Printf ("acquire failed:%+v\n " , acquireResp )
548
- return
549
- }
550
-
551
- resourceId := acquireResp .SuccessRes .ResourceId
552
- // start
553
- startResp , err := s .CloudRecordingClient .IndividualRecording ().Start (ctx , resourceId , s .Cname , s .Uid , & req.StartIndividualRecordingClientRequest {
554
- Token : token ,
555
- RecordingConfig : & cloudRecordingAPI.RecordingConfig {
556
- ChannelType : 1 ,
557
- StreamTypes : 0 ,
558
- StreamMode : "original" ,
559
- MaxIdleTime : 30 ,
560
- SubscribeAudioUIDs : []string {
561
- "#allstream#" ,
562
- },
563
- SubscribeUidGroup : 0 ,
564
- },
565
- RecordingFileConfig : & cloudRecordingAPI.RecordingFileConfig {
566
- AvFileType : []string {
567
- "hls" ,
568
- },
569
- },
570
- StorageConfig : storageConfig ,
571
- AppsCollection : & cloudRecordingAPI.AppsCollection {
572
- CombinationPolicy : "postpone_transcoding" ,
573
- },
574
- TranscodeOptions : & cloudRecordingAPI.TranscodeOptions {
575
- Container : & cloudRecordingAPI.Container {
576
- Format : "mp3" ,
577
- },
578
- TransConfig : & cloudRecordingAPI.TransConfig {
579
- TransMode : "audioMix" ,
580
- },
581
- Audio : & cloudRecordingAPI.Audio {
582
- SampleRate : "48000" ,
583
- BitRate : "48000" ,
584
- Channels : "2" ,
585
- },
586
- },
587
- })
588
- if err != nil {
589
- log .Println (err )
590
- return
591
- }
592
- if startResp .IsSuccess () {
593
- log .Printf ("start success:%+v\n " , startResp )
594
- } else {
595
- log .Printf ("start failed:%+v\n " , startResp )
596
- return
597
- }
598
-
599
- sid := startResp .SuccessResponse .Sid
600
- // stop
601
- defer func () {
602
- stopResp , err := s .CloudRecordingClient .IndividualRecording ().Stop (ctx , resourceId , sid , s .Cname , s .Uid , false )
603
- if err != nil {
604
- log .Println (err )
605
- return
606
- }
607
- if stopResp .IsSuccess () {
608
- log .Printf ("stop success:%+v\n " , stopResp )
609
- } else {
610
- log .Printf ("stop failed:%+v\n " , stopResp )
611
- return
612
- }
613
- }()
614
-
615
- // query
616
- for i := 0 ; i < 3 ; i ++ {
617
- queryResp , err := s .CloudRecordingClient .IndividualRecording ().Query (ctx , resourceId , sid )
618
- if err != nil {
619
- log .Println (err )
620
- return
621
- }
622
- if queryResp .IsSuccess () {
623
- log .Printf ("query success:%+v\n " , queryResp )
624
- } else {
625
- log .Printf ("query failed:%+v\n " , queryResp )
626
- return
627
- }
628
- time .Sleep (time .Second * 10 )
629
- }
630
-
631
- // update
632
- updateResp , err := s .CloudRecordingClient .IndividualRecording ().Update (ctx , resourceId , sid , s .Cname , s .Uid , & req.UpdateIndividualRecordingClientRequest {
633
- StreamSubscribe : & cloudRecordingAPI.UpdateStreamSubscribe {
634
- AudioUidList : & cloudRecordingAPI.UpdateAudioUIDList {
635
- SubscribeAudioUIDs : []string {
636
- "#allstream#" ,
637
- },
638
- },
639
- },
640
- })
641
- if err != nil {
642
- log .Println (err )
643
- return
644
- }
645
- if updateResp .IsSuccess () {
646
- log .Printf ("update success:%+v\n " , updateResp )
647
- } else {
648
- log .Printf ("update failed:%+v\n " , updateResp )
649
- return
650
- }
651
-
652
- // query
653
- for i := 0 ; i < 3 ; i ++ {
654
- queryResp , err := s .CloudRecordingClient .IndividualRecording ().Query (ctx , resourceId , sid )
655
- if err != nil {
656
- log .Println (err )
657
- return
658
- }
659
- if queryResp .IsSuccess () {
660
- log .Printf ("query success:%+v\n " , queryResp )
661
- } else {
662
- log .Printf ("query failed:%+v\n " , queryResp )
663
- return
664
- }
665
- time .Sleep (time .Second * 10 )
666
- }
667
- }
0 commit comments