Skip to content

Commit 3c86f88

Browse files
committed
Autoplay on addLocalStream
1 parent 9858aad commit 3c86f88

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

js/rtc-controller.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ var CONTROLLER = window.CONTROLLER = function(phone, stream){
6767
video.volume = 0.0;
6868
video.play();
6969
//vid.innerHTML=""
70+
vid.setAttribute( 'autoplay', 'autoplay' );
7071
vid.setAttribute( 'data-number', phone.number() );
7172
vid.style.cssText ="-moz-transform: scale(-1, 1); \
7273
-webkit-transform: scale(-1, 1); -o-transform: scale(-1, 1); \

js/webrtc.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var PHONE = window.PHONE = function(config) {
1616
var myconnection = false;
1717
var mediaconf = config.media || { audio : true, video : true };
1818
var conversations = {};
19-
var streamWatch = config.streamWatch || false;
19+
var oneway = config.oneway || false;
2020

2121
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
2222
// RTC Peer Connection Session (one per call)
@@ -403,7 +403,7 @@ var PHONE = window.PHONE = function(config) {
403403
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
404404
function onready(subscribed) {
405405
if (subscribed) myconnection = true;
406-
if (!((mystream || streamWatch) && myconnection)) return;
406+
if (!((mystream || oneway) && myconnection)) return;
407407

408408
connectcb();
409409
readycb();
@@ -413,7 +413,7 @@ var PHONE = window.PHONE = function(config) {
413413
// Prepare Local Media Camera and Mic
414414
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
415415
function getusermedia() { //Do something if not requesting any media?
416-
if (streamWatch){
416+
if (oneway){
417417
onready();
418418
subscribe();
419419
return;

streams.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
addLog("Streaming to " + streamName);
9191
});
9292
ctrl.receive(function(session){
93-
session.connected(function(session){ session.pc.close(); addLog(session.number + " has joined."); });
93+
session.connected(function(session){ addLog(session.number + " has joined."); });
9494
session.ended(function(session) { addLog(session.number + " has left."); console.log(session)});
9595
});
9696
ctrl.streamPresence(function(m){

0 commit comments

Comments
 (0)