我想在iOS(9.3)與
cordova-plugin-opentokjs(
https://www.npmjs.com/package/cordova-plugin-opentokjs)
cordova-plugin-iosrtc上工作的雙向視頻聊天。我正在使用cordova 6.3.0和OpenTok 2.8.1。我遇到的問題是,當我開始了我的視頻從用戶流得到一個錯誤如下:OpenTok與科爾多瓦錯誤1013媒體資源不適合
[Error] TypeError: undefined is not a constructor (evaluating 'new global.AudioContext()')
[Error] OT.exception :: title: Connection Failed (1013) msg: OT.Subscriber PeerConnection Error: There was an unexpected problem with the Video Stream: The media resource indicated by the src attribute was not suitable.
[Error] No message (2)
[Error] OT.exception :: title: Unexpected Server Response (2001) msg: Unexpected server response. Try this operation again later.
出版商流正常工作......至少我可以看到自己(而其他用戶看不到我)。有任何想法嗎?
下面是一些相關的代碼:
this.onDeviceReady = function() {
if (window.device.platform === 'iOS') {
cordova.plugins.iosrtc.registerGlobals();
}
};
當我轉到視頻頁面怎麼辦?(打電話initializeSession):
...
initializePublisher: function() {
var self = this;
if (Globals.debug)
console.log("initializePublisher");
if (!this.videoInputDevices || this.videoInputDevices.length === 0)
return;
var inputDevice = this.videoInputDevices[this.currentVideoDevice];
if (!inputDevice || !inputDevice.deviceId)
return;
var $contianer = $('#openTokVideoContainer .mnOpenTokPublisherContainer');
$contianer.empty();
var $div = $('<div id="openTokPublisherStream"></div>');
$contianer.append($div);
this.publisher = OT.initPublisher('openTokPublisherStream', {
width: '100%',
height: '100%',
fitMode: 'contain',
videoSource: inputDevice.deviceId,
mirror: (this.currentVideoDevice === 0)
});
this.publisher.on('streamCreated', function(e) {
var stream = e.stream,
streamId = stream.streamId,
$div = $('#openTokVideoContainer .mnOpenTokPublisherContainer > *');
$div.attr('data-stream', streamId);
console.log("Publisher stream: ", streamId);
});
this.session.publish(this.publisher);
},
initializeSession: function() {
var config = this.config,
self = this;
if (Globals.debug)
console.log("initializeSession");
if (Globals.debug)
console.log("INIT SESSION " + config.sessionId + " TOKEN" + config.token);
this.session = OT.initSession(config.apiKey, config.sessionId);
this.session.on('streamCreated', function(e) {
var config = self.config;
if (Globals.debug)
console.log("onSessionConnected");
self.subscribeToStream(e.stream, 'mnOpenTokSubscriberContainer');
if (Globals.debug)
console.log("Stream created ");
});
this.session.on('streamDestroyed', function(e) {
self.closeAllStreamSubscriptions(e.stream);
});
this.session.connect(config.token, function (e) {
if (!self.publisher) {
self.getVideoDevices().then(function() {
self.initializePublisher();
});
}
});
if (Globals.debug)
console.log("initializeSession");
},...
幫助?
編輯:經過大量的頭部猛擊,插件更新等,我現在已經把它給我下面的錯誤(和公佈的視頻不再工作):
[Error] TypeError: undefined is not a constructor (evaluating 'new u(n.content)')
[Error] TypeError: undefined is not a constructor (evaluating 'new u(n.content)')
[Error] TypeError: undefined is not a constructor (evaluating 'new u(n.content)')
[Error] TypeError: undefined is not a constructor (evaluating 'new u(n.content)')
[Error] TypeError: undefined is not a constructor (evaluating 'new t({type:"offer",sdp:l.content.sdp})')
[Error] TypeError: undefined is not a constructor (evaluating 'new u(n.content)')
[Error] TypeError: undefined is not a constructor (evaluating 'new u(n.content)')
[Error] TypeError: undefined is not a constructor (evaluating 'new u(n.content)')
[Error] TypeError: undefined is not a constructor (evaluating 'new u(n.content)')
[Error] TypeError: undefined is not a constructor (evaluating 'new u(n.content)')
[Error] TypeError: undefined is not a constructor (evaluating 'new u(n.content)')
[Error] TypeError: undefined is not a constructor (evaluating 'new u(n.content)')
[Error] TypeError: undefined is not a constructor (evaluating 'new u(n.content)')
[Error] TypeError: undefined is not a constructor (evaluating 'new u(n.content)')
[Error] TypeError: undefined is not a constructor (evaluating 'new u(n.content)')
[Error] TypeError: undefined is not a constructor (evaluating 'new u(n.content)')
[Error] TypeError: undefined is not a constructor (evaluating 'new u(n.content)')
[Error] TypeError: undefined is not a constructor (evaluating 'new u(n.content)')
[Error] TypeError: undefined is not a constructor (evaluating 'new u(n.content)')
[Error] TypeError: undefined is not a constructor (evaluating 'new u(n.content)')
[Error] TypeError: undefined is not a constructor (evaluating 'new u(n.content)')
[Error] TypeError: undefined is not a constructor (evaluating 'new u(n.content)')
[Error] TypeError: undefined is not a constructor (evaluating 'new u(n.content)')
[Error] TypeError: undefined is not a constructor (evaluating 'new u(n.content)')
[Error] TypeError: undefined is not a constructor (evaluating 'new u(n.content)')
[Error] OT.Publisher.onStreamAvailableError TypeError: Unknown Error while getting user media
[Error] OT.exception :: title: Unable to Publish (1500) msg: GetUserMedia
[Error] No message (2)
[Error] No message (2)
[Error] OT.exception :: title: Unexpected Server Response (2001) msg: Unexpected server response. Try this operation again later.