Hi.
I don’t know why but when i implemented my code session.publish doesn’t work.
I create ionic app
I can create session i can create token i can connect to session but last step doesn’t work. It doesn’t fire any error or something.
this.publisher = this.OV.initPublisher(undefined, {
audioSource: undefined, // The source of audio. If undefined default microphone
videoSource: undefined, // The source of video. If undefined default webcam
publishAudio: true, // Whether you want to start publishing with your audio unmuted or not
publishVideo: true, // Whether you want to start publishing with your video enabled or not
resolution: ‘640x480’, // The resolution of your video
frameRate: 30, // The frame rate of your video
insertMode: ‘APPEND’, // How the video is inserted in the target element ‘video-container’
mirror: false // Whether to mirror your local video or not
});
// --- 6) Publish your stream ---
console.log(this.session); -> can see at console
console.log(this.publisher); -> can see at console
this.publisher.on('streamCreated', (data) => {
console.log(data);
});
this.publisher.on('remoteVideoPlaying', (data) => {
console.log(data);
});
this.publisher.on('accessAllowed', (data) => {
console.log(data);
});
this.publisher.on('accessDenied', (data) => {
console.log(data);
});
this.session.publish(this.publisher as Publisher).then(() => {
// Store our Publisher
console.log('publis', this.publisher); -> can't see at console
const sendData = {
user: this.user._id,
live: true,
session: this.sessionId,
openviSession: this.openviSession
};
this.api.createStream(sendData)
.subscribe((res: any) => {
this.selfStream = res;
});
}, (err: any) => {
console.log('err', err);-> can't see at console
}).catch((reject) => {
console.log(reject);-> can't see at console
})
here is the code