accessKeyId = SystemConfigService::get('accessKeyId'); // 您的AccessKey Secret $config->accessKeySecret =SystemConfigService::get('accessKeySecret'); // 您的可用区ID $config->regionId = $regionId; return new Vod($config); } /** * @param Vod $client * @param string $videoId * @return GetPlayInfoResponse */ public static function GetPlayInfoSample($client, $videoId){ $request = new GetPlayInfoRequest([]); // 视频ID。 $request->videoId = $videoId; $request->formats= 'm3u8'; $response = $client->getPlayInfo($request); return $response; } /** * @param string[] $args * @return void */ public static function main($args){ try { $regionId = @$args[0]; $videoId = @$args[1]; $client = self::Initialization($regionId); $responseGetPlayInfo = self::GetPlayInfoSample($client, $videoId); return $responseGetPlayInfo->body->playInfoList->playInfo[0]->playURL; // return Utils::toJSONString(Utils::toMap($responseGetPlayInfo)); } catch (\Throwable $error) { if (!($error instanceof TeaError)) { $error = new TeaError([], $error->getMessage(), $error->getCode(), $error); } return $error->message ; } } }