Removed the css and adapter.js file since they were basically empty.
This commit is contained in:
Родитель
d899628c06
Коммит
ceea68078d
44
adapter.js
44
adapter.js
|
@ -1,44 +0,0 @@
|
|||
var RTCPeerConnection = null;
|
||||
var getUserMedia = null;
|
||||
var attachMediaStream = null;
|
||||
var reattachMediaStream = null;
|
||||
var webrtcDetectedBrowser = null;
|
||||
|
||||
webrtcDetectedBrowser = "chrome";
|
||||
|
||||
// The RTCPeerConnection object.
|
||||
RTCPeerConnection = webkitRTCPeerConnection;
|
||||
|
||||
// Get UserMedia (only difference is the prefix).
|
||||
// Code from Adam Barth.
|
||||
getUserMedia = navigator.webkitGetUserMedia.bind(navigator);
|
||||
|
||||
// Attach a media stream to an element.
|
||||
attachMediaStream = function(element, stream) {
|
||||
element.src = webkitURL.createObjectURL(stream);
|
||||
};
|
||||
|
||||
reattachMediaStream = function(to, from) {
|
||||
to.src = from.src;
|
||||
};
|
||||
|
||||
// The representation of tracks in a stream is changed in M26.
|
||||
// Unify them for earlier Chrome versions in the coexisting period.
|
||||
if (!webkitMediaStream.prototype.getVideoTracks) {
|
||||
webkitMediaStream.prototype.getVideoTracks = function() {
|
||||
return this.videoTracks;
|
||||
};
|
||||
webkitMediaStream.prototype.getAudioTracks = function() {
|
||||
return this.audioTracks;
|
||||
};
|
||||
}
|
||||
|
||||
// New syntax of getXXXStreams method in M26.
|
||||
if (!webkitRTCPeerConnection.prototype.getLocalStreams) {
|
||||
webkitRTCPeerConnection.prototype.getLocalStreams = function() {
|
||||
return this.localStreams;
|
||||
};
|
||||
webkitRTCPeerConnection.prototype.getRemoteStreams = function() {
|
||||
return this.remoteStreams;
|
||||
};
|
||||
}
|
|
@ -7,10 +7,20 @@
|
|||
color: white;
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
html, body {
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
#video {
|
||||
width:100%;
|
||||
height:100%;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
</style>
|
||||
<script src="adapter.js"></script>
|
||||
<script src="player.js"></script>
|
||||
<link rel='stylesheet' href="player.css"></link>
|
||||
</head>
|
||||
<body>
|
||||
<video id="video" autoplay="true"></video><br/>
|
||||
|
|
40
player.css
40
player.css
|
@ -1,40 +0,0 @@
|
|||
#header {
|
||||
display:none;
|
||||
}
|
||||
|
||||
html, body {
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
#remote{
|
||||
width:100%;
|
||||
margin-left:250px;
|
||||
margin-right:auto;
|
||||
}
|
||||
|
||||
#remote-caption{
|
||||
display:none;
|
||||
}
|
||||
|
||||
#local {
|
||||
display:none;
|
||||
width:0px;
|
||||
}
|
||||
|
||||
#logwindow{
|
||||
clear:both;
|
||||
display:none;
|
||||
}
|
||||
|
||||
#status{
|
||||
clear:both;
|
||||
display:none;
|
||||
}
|
||||
|
||||
#video {
|
||||
width:100%;
|
||||
height:100%;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
|
@ -14,7 +14,8 @@ var CallingClient = function(divs) {
|
|||
config.iceServers = [];
|
||||
config.iceServers.push({"url":"stun:stun.services.mozilla.com"});
|
||||
|
||||
this.pc = new RTCPeerConnection(config, {});
|
||||
// webkitRTCPeerConnection is Chrome specific
|
||||
this.pc = new webkitRTCPeerConnection(config, {});
|
||||
|
||||
if (this.pc) {
|
||||
log("Created PC object");
|
||||
|
@ -25,7 +26,8 @@ var CallingClient = function(divs) {
|
|||
// Set callbacks or new media streams
|
||||
this.pc.onaddstream = function(obj) {
|
||||
log("Adding video stream");
|
||||
attachMediaStream(divs.remote_video, obj.stream);
|
||||
// This line is Chrome specific
|
||||
divs.remote_video.src = webkitURL.createObjectURL(obj.stream);
|
||||
}
|
||||
this.pc.onicecandidate = this._onIceCandidate.bind(this);
|
||||
this.pc.onsignalingstatechange = this._onSignalingStateChange.bind(this);
|
||||
|
|
Загрузка…
Ссылка в новой задаче