我正在尝试使用 Agora.io 直播视频系统。但我在开发人员控制台中收到以下错误。
单击加入按钮后,我收到以下错误。
Agora-SDK [ERROR]: [713FF] Get server node failed [DYNAMIC_USE_STATIC_KEY] https://webrtc2-ap-web-1.agora.io/api/v1 DYNAMIC_USE_STATIC_KEY agora.js:161:41
Agora-SDK [INFO]: [713FF] Join failed: DYNAMIC_USE_STATIC_KEY agora.js:155:41
[ERROR] : join channel failed DYNAMIC_USE_STATIC_KEY live:1146:15
我得在agora管理面板上做个安排。我究竟做错了什么。
var rand = <?php echo rand(1111111,9999999); ?>;
var agoraAppId = 'API ID HERE'; // set app id
var channelName = "stream_<?php echo $creatorUserID;?>_"+rand; // set channel name
// join a channel
function joinChannel() {
var token = generateToken();
var userID = 0; // set to null to auto generate uid on successfull connection
// set the role
client.setClientRole('host', function() {
console.log('Client role set as host.');
}, function(e) {
console.log('setClientRole failed', e);
});
// client.join(token, 'allThingsRTCLiveStream', 0, function(uid) {
client.join(token, channelName, userID, function(uid) {
createCameraStream(uid, {});
localStreams.uid = uid; // keep track of the stream uid
console.log('User ' + uid + ' joined channel successfully');
$('#main_live_video').html('')
$('#publishBtn').removeAttr('disabled');
$('#publishBtn').text("Please Wait");
$('#publishBtn').addClass('hidden');
$('.end_vdo_call').removeClass('hidden');
$.post(requestUrl + "?f=live", {stream_name: channelName}, function(data, textStatus, xhr) {
if (data.status == 200) {
$('#live_post_id').val(data.post_id);
}
});
}, function(err) {
console.log('[ERROR] : join channel failed', err);
});
}
function generateToken() {
return null; // TODO: add a token generation
}