建立直播頻道

2021-08-17 19:46:05 字數 3067 閱讀 3454

//取得保利威視直播基礎引數

//簽名驗證必需引數

$userid = $live_config['userid'];//直播賬號id

$timestamp = time()*1000;

turnover("a=do_polyv","錯誤:請先配置api引數!");

}//建立直播頻道

//介面需要的引數(非sign)賦值

//$userid = "******xx";//直播使用者id

$name = $title;//直播頻道名稱

$channelpasswd = "123456";//頻道密碼

$courseid = "123456";//課程號

$params = array(

'autoplay'=>$autoplay,

'name'=>$name,

'courseid'=>$courseid,

'playercolor'=>$playercolor,

'timestamp'=>$timestamp,

'userid'=>$userid,

'channelpasswd'=>$channelpasswd,

'timestamp'=>$timestamp

);//生成sign 簽名生成規則

//$sign = getsign($params); //詳細檢視config.php檔案的getsign方法

// 1. 對加密陣列進行字典排序

foreach ($params as $key=>$value)

sort($arr);

foreach ($arr as $k => $v)

$sign = strtoupper(md5($restr));

$data = array(

'autoplay'=>$autoplay,

'name'=>$name,

'courseid'=>$courseid,

'playercolor'=>$playercolor,

'timestamp'=>$timestamp,

'userid'=>$userid,

'channelpasswd'=>$channelpasswd,

'sign'=>$sign

);$url = "";

//$ch = curl_init() or die ( curl_error() );

$ch = curl_init();

curl_setopt( $ch, curlopt_url, $url);

curl_setopt( $ch, curlopt_postfields, $data);

curl_setopt( $ch, curlopt_returntransfer, 1 );

curl_setopt( $ch, curlopt_connecttimeout, 360);

$response = curl_exec ( $ch );

curl_close ( $ch );

//echo $response;

//錯誤資訊提示

// if ($response === false) a=doindex",curl_error($ch));die;

// // echo "curl 具體出錯資訊: " . curl_error($ch);

// }

//取得返回陣列

$jsonstr=$response;;

$arr = json_decode($jsonstr, true);

$code = $arr['code'];//code=200 說明成功

$message=$arr['message'];

// turnover("a=doindex","channelid=".$channelid);die;

if($code==200) set pid = '$p_id',channelid = '$channelid',userid = '$userid',name = '$name',description = '$description',url = '$url',stream = '$stream',logoimage = '$logoimage',logoopacity = '$logoopacity',logoposition = '$logoposition',logohref = '$logohref',coverimage = '$coverimage',coverhref = '$coverhref',waitimage = '$waitimage',waithref = '$waithref',cutoffimage = '$cutoffimage',cutoffhref = '$cutoffhref',adverttype = '$adverttype',advertduration = '$advertduration',advertwidth = '$advertwidth',advertheight = '$advertheight',advertimage = '$advertimage',adverthref = '$adverthref',advertflvvid = '$advertflvvid',advertflvurl = '$advertflvurl',playercolor = '$playercolor',autoplay = '$autoplay',warmupflv = '$warmupflv',passwdrestrict = '$passwdrestrict',passwdencrypted = '$passwdencrypted',isonlyaudio = '$isonlyaudio',islowlatency = '$islowlatency',m3u8url = '$m3u8url',m3u8url1 = '$m3u8url1',m3u8url2 = '$m3u8url2',m3u8url3 = '$m3u8url3',currenttimemillis = '$currenttimemillis'";

db::query($query58);

}elsea=doindex",curl_error($ch));die;

}}elsea=doindex","錯誤:新增失敗!");

}

官方文件:

騰訊雲直播 管理端查詢直播中頻道列表

引數名引數含義 型別備註 是否必需 客戶 id inty inte ce 介面名stringyt 有效截止時間戳 inty sign 簽名string md5 key 有效截止時間戳 y引數名 引數含義 型別備註 ret返回碼 int0 表示成功 其他值 表示失敗 message 錯誤資訊 stri...

隱藏頻道 《TED頻道》 隱藏真實自我

ted頻道 隱藏真實自我 一 詞彙解析 vi.出現,浮現 暴露 擺脫 例句 when you read this article,has a person always emerge in your mind.當你讀這篇文章的時候,有個人一直在你的腦中浮現。過去式 emerged adj.休假的,公...

移動直播app軟體直播平台怎麼建立

一 研究背景 二 概念界定 二 移動學習 移動學習 mobile learning 是一種在移動計算裝置幫助下的能夠在任何時間 任何地點發生的學習,移動學習所使用的移動計算裝置必須能夠有效地呈現學習內容並且提供教師與學習者之間的雙向交流。移動學習的特點是 移動性 情境性 及時性 跨時空性 互動性 普...