Index.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\live\controller;
  12. use app\admin\model\live\LiveStudio;
  13. use service\SystemConfigService;
  14. class Index extends \think\Controller
  15. {
  16. /**
  17. * 直播推流回调
  18. * */
  19. public function serve()
  20. {
  21. $request = $this->request->request();
  22. $id = isset($request['id']) ? $request['id'] : '';
  23. $action = $this->request->request('action', '');
  24. $is_play = $action == 'publish' ? 1 : 0;
  25. LiveStudio::setLivePalyStatus($id, $is_play, $action);
  26. }
  27. /**
  28. * 直播录制回调
  29. * */
  30. public function record()
  31. {
  32. }
  33. public function test()
  34. {
  35. $aliyunLive = \Api\AliyunLive::instance([
  36. 'AccessKey' => SystemConfigService::get('accessKeyId'),
  37. 'AccessKeySecret' => SystemConfigService::get('accessKeySecret'),
  38. 'OssEndpoint' => SystemConfigService::get('aliyun_live_end_point'),
  39. 'OssBucket' => SystemConfigService::get('aliyun_live_oss_bucket'),
  40. 'appName' => SystemConfigService::get('aliyun_live_appName'),
  41. 'payKey' => SystemConfigService::get('aliyun_live_play_key'),
  42. 'key' => SystemConfigService::get('aliyun_live_push_key'),
  43. 'playLike' => SystemConfigService::get('aliyun_live_playLike'),
  44. 'rtmpLink' => SystemConfigService::get('aliyun_live_rtmpLink'),
  45. ]);
  46. $res = $aliyunLive->createLiveRecordConfig(95292930,1582271537);
  47. var_dump($res,$aliyunLive->getErrorInfo());
  48. }
  49. }