|
本帖最后由 绯叶 于 2017-2-23 15:56 编辑
- function join(obj) {
- var client, localStream;
-
- require(["$UI/TarotAPP/Agora_Web_SDK_v1_8_0_FULL/v1.8_beta/client/vendor/socket.io"],function(){
- require(["$UI/TarotAPP/Agora_Web_SDK_v1_8_0_FULL/v1.8_beta/client/vendor/adapter"],function(){
- require(["$UI/TarotAPP/Agora_Web_SDK_v1_8_0_FULL/v1.8_beta/client/AgoraRTCSDK-1.8.0"],function(){
- console.log("Init AgoraRTC client with vendor key: " + 'd1b46bb198a64f039');
-
- client = AgoraRTC.createLiveClient();
- client.init('d1b46bb198a64f039', function () {
- console.log("AgoraRTC client initialized");
- client.join('111', undefined, function (uid) {
- console.log("User " + uid + " join channel successfully");
- localStream = AgoraRTC.createStream({ streamID: uid, audio: true, video: true, screen: false });
- localStream.init(function () {
- console.log("getUserMedia successfully");
- alert(obj.getIDByXID('div107_paly'));
- localStream.play(obj.getIDByXID('div107_paly'));
- client.publish(localStream, function (err) {
- console.log("Publish local stream error: " + err);
- });
- client.on('stream-published', function (evt) {
- console.log("Publish local stream successfully");
- });
- }, function (err) {
- console.log("getUserMedia failed", err);
- });
- }, function (err) {
- console.log("Join channel failed", err);
- });
- }, function (err) {
- console.log("AgoraRTC client init failed", err);
- });
-
- });
-
-
- });
-
- });
- }
复制代码
这样引用js写法对不对 总是提示is not defeind |
|