Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screen sharing receiver does not work in Safari #704

Open
lawlietmester opened this issue May 22, 2018 · 4 comments
Open

Screen sharing receiver does not work in Safari #704

lawlietmester opened this issue May 22, 2018 · 4 comments

Comments

@lawlietmester
Copy link

Right now there are not so many details:
Screen sharer is using Chrome on Windows 10, receiver of the screen uses Safari 11.0.3.
Standalone file simplewebrtc library, separate webrtc adapter also as file (last version).
Signaling same as in default properties.
The same code works if the receiver is Chrome/FF/Edge.

No errors in Safari console. But also no videoAdded event, no peerStreamAdded event. In other browsers, there are such events.

More details in future

@lawlietmester
Copy link
Author

lawlietmester commented Jun 5, 2018

Screen sharer:

/** @type {(String|undefined)} */
let { streamId } = await Browser.desktopCapture.chooseDesktopMedia(
	[ 'screen', 'window', 'tab' ]
);

/** @type {Object} */
let constraints = {
	'audio': false,
	'video': {
		'mandatory': {
			'chromeMediaSource': 'desktop',
			'chromeMediaSourceId': streamId,
			'maxWidth': resolutions.maxWidth,
			'maxHeight': resolutions.maxHeight,
			'minWidth': 100,
			'minHeight': 100,
			'minAspectRatio': getAspectRatio( resolutions.maxWidth, resolutions.maxHeight ),
			'maxAspectRatio': getAspectRatio( resolutions.maxWidth, resolutions.maxHeight ),
			'minFrameRate': 5,
			'maxFrameRate': 30
		},
		'optional': []
	}
};

/** @type {SimpleWebRTC} */
let connection = new SimpleWebRTC({
	'url': OUR_SIGNALING_SERVER,
	'debug': true,
	'socketio': { 'force new connection': true },
	'enableDataChannels': false,
	'peerConnectionConfig': {
		'iceServers': [
      { 'urls': 'stun:stun.l.google.com:19302' }
    ]
	}
});

connection.on( 'connectionReady', () => {
	connection.joinRoom( roomId );
});

try {
	await new Promise( ( resolve, reject ) => {
		connection.webrtc.startScreenShare( constraints, ( error, stream ) => {
			if( error ) reject( error );
			resolve( stream );
		});
	});
}
catch ( error ) {
	// Handle error
}

Receiver:

var webrtc = new SimpleWebRTC({
	'url': OUR_SIGNALING_SERVER,

	// the id/element dom element that will hold remote videos
	'remoteVideosEl': '#remoteVideos', // document.querySelector( '#remoteVideos' ),

	'debug': true,

	'media': {
		'video': false,
		'audio': false
	},
	'peerConnectionConfig': {
		'iceServers': [
      { 'urls': 'stun:stun.l.google.com:19302' }
    ]
	},
	'receiveMedia': {
		'offerToReceiveAudio': false,
		'offerToReceiveVideo': true
	}
});

webrtc.on( 'connectionReady', function() {
	text.value = 'Connecting to STUN/TURN servers';

	// you can name it anything
	webrtc.joinRoom( roomId );
});

webrtc.on( 'videoAdded', element => {
	document.querySelector( 'div.Video' ).appendChild( element );
});

Screen sharer always Chrome (tested on Mac/Windows 10). Receiver of video can be any browser. Receiver works in last FF, Chrome and Edge on Windows. But does not works on Safari (works on Chrome on same Mac, where Safari is installed).

Also I tested pure JS webrtc with webrtc adapter - it works on Safari.

@lawlietmester
Copy link
Author

Bugfix #1: otalk/attachMediaStream#19

@lawlietmester
Copy link
Author

Bugfix #2: otalk/RTCPeerConnection#97

@JakeTrock
Copy link

Can we close this issue? it seems like it was resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants