You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
943 B
34 lines
943 B
<?php
|
|
|
|
namespace app\api\controller\video;
|
|
|
|
use app\api\controller\Controller;
|
|
use app\common\dm\Dm;
|
|
|
|
class Video extends Controller
|
|
{
|
|
|
|
public function getVideo()
|
|
{
|
|
$config = config('api_config');
|
|
$urlArr = [];
|
|
$dm = new Dm();
|
|
$list = $dm->select('bt_video',null,'"cameraName", "cameraIndexCode"','',3);
|
|
foreach ($list as $key => $row) {
|
|
$urlArr[] = [
|
|
'host' => $config['host'],
|
|
'port' => $config['port'],
|
|
'appkey' => $config['cid'],
|
|
'secret' => $config['cskey'],
|
|
'cameraName' => $row['cameraName'],
|
|
'key' => "camera" . $key,
|
|
'cameraIndexCode' => $row['cameraIndexCode']
|
|
];
|
|
}
|
|
|
|
|
|
$base64 = base64_encode(json_encode($urlArr)) . "==";
|
|
$videoData = base64_encode($base64);
|
|
return $this->renderSuccess(compact('videoData'));
|
|
}
|
|
}
|