我正在用wordpress建立一个多供应商网站,用于网络研讨会和课程,我正在使用Dokan插件。我想把会议作为我的供应商的产品来使用。
所以这就是我所想的:当usera在mywebsite.com上注册一个帐户时,agora.io应用程序接口使用来自usera帐户的用户名创建一个通道,然后生成一个包含(appid,token,channel)相关信息的响应。
当用户A登录mywebsite.com时,其agora.io接口(appid、令牌、频道)的相关信息会自动填充:
var appID = 'user[a]app1D';
var Token = 'user[a]t0k3n';
var channel = 'user[a]channel';非常感谢您的帮助。
发布于 2021-03-11 09:39:25
我建议您查看一下Agora Video for Wordpress plugin并使用QuickStart Guide来确保它设置正确。
Agora Video for Wordpress插件不会以上述方式自动创建频道,但您可以很容易地将该功能添加到WordPress实例中。
当用户创建帐户时,您需要创建一个新的Agora Channel,这将提供频道ID。然后使用Agora短代码创建一个页面,并传递频道ID。
发布于 2021-04-28 02:58:17
妮可,我正面临着同样的问题,并找到了一个解决方案。AGORA频道和任何其他频道一样都是帖子。
您需要:
使用post_type创建帖子: agora_channel
我已经解决了这个问题:
$id = wp_insert_post(array(
'post_title'=>'Channel of' . $user->display_name,
'post_type'=>'agora_channel',
'post_content' => ''
));
if(!is_wp_error($id)){
update_post_meta($id, 'channel_appearance_settings', array(
'external-rtmpServerURL' => '',
'external-streamKey' => '',
'external-width' => 640,
'external-height' => 360,
'external-videoBitrate' => 400,
'external-videoFramerate' => 15,
'external-videoGop' => 30,
'external-lowLatency' => false,
'external-audioSampleRate' => 48000,
'external-audioBitrate' => 48,
'external-audioChannels' => 1,
'external-videoCodecProfile' => 100,
'external-backgroundColor' => '#efefef',
'inject-width' => 640,
'inject-height' => 360,
'inject-videoBitrate' => 400,
'inject-videoFramerate' => 15,
'inject-videoGop' => 30,
'inject-lowLatency' => false,
'inject-audioSampleRate' => 48000,
'inject-audioBitrate' => 48,
'inject-audioChannels' => 1,
'inject-videoCodecProfile' => 100,
'inject-backgroundColor' => '#efefef',
)
);
update_post_meta($id, 'channel_appearance_settings', array(
'splashImageURL' => "",
'noHostImageURL' => '',
'watchButtonText' => '',
'watchButtonIcon' => false,
'activeButtonColor' => '#343a40',
'disabledButtonColor' => '#dc3545',
));
update_post_meta($id, 'channel_type','broadcast');
update_post_meta($id, 'channel_appearance_settings', array(
'splashImageURL' => '',
'noHostImageURL' => '',
'watchButtonText' => '',
'watchButtonIcon' => true,
'activeButtonColor' => '#fdb911',
'disabledButtonColor' => '#bfbfbf'
)
);
update_post_meta($id, 'channel_user_host', $user->ID);
}https://stackoverflow.com/questions/66210527
复制相似问题