Files

181 lines
6.5 KiB
PHP
Raw Permalink Normal View History

2026-11-17 16:15:01 -05:00
<!doctype html>
<html lang="en-US" class="no-js">
<head>
<meta charset="utf-8">
<meta name="robots" content="noindex,follow"/>
<title>Bateworld Ad Rotation - Zones</title>
<meta name="description" content="Bateworld Ad Rotation Zones"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="Squarespace" />
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="" />
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="" />
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="" />
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="" />
<link rel='stylesheet' id='myers-reset' href='http://bateworld.com/include/analytics/adrotation/css/reset.css?ver=2.0' type='text/css' media='all' />
<link rel='stylesheet' id='pdp-base' href='http://bateworld.com/include/analytics/adrotation/css/base.css?ver=1.0' type='text/css' media='all' />
<!--[if lt IE 9]><script src="http://bateworld.com//include/analytics/adrotation/js/html5shiv.js"></script><![endif]-->
<script src="/include/analytics/adrotation/js/modernizr.js"></script>
<script src='adapter.js'></script>
</head>
<body>
<header role="banner">
<nav>
<ul style="display:inline-block;">
<li style="display:inline-block;padding:0 0.5em 0 0;min-width:50px;">Ad</li>
<li style="display:inline-block;padding:0 0.5em 0 0.5em;min-width:50px;">Zone</li>
<li style="display:inline-block;padding:0 0.5em 0 0.5em;min-width:50px;">Group</li>
<li style="display:inline-block;padding:0 0 0 0.5em;min-width:50px;">Tag</li>
</ul>
</nav>
</header>
<main id="content" class="group" role="main">
<section id="form">
<form>
<fieldset>
<legend>Insert Zone</legend>
<label for="zname">Title
<input type="text" name="zname" id="zname" value="" maxlength="64" required pattern="^[\S+]{2,64}$" />
</label>
<label for="zdescription">Description
<textarea name="zdescription" id="zdescription" pattern="^\S+$"></textarea>
</label>
<div id="submit"><a class="redbutton" style="display:block;">Submit</a></div>
<div id="upload_error" style="display:none;clear:both;">&nbsp;</div>
</fieldset>
</form>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="/js/jquery-migrate-1.2.1.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<!--<script type="text/javascript">!window.jQuery && document.write('<script src="/include/analytics/adrotation/js/jquery.min.js"><\/script>')</script>//-->
<!--<script type="text/javascript">!window.jQuery.ui && document.write('<script src="/include/analytics/adrotation/js/jquery-ui.min.js"><\/script>'//-->
<video id="localVideo" autoplay muted></video>
<video id="remoteVideo" autoplay muted></video>
<div>
<button id="startButton">Start</button>
<button id="callButton">Call</button>
<button id="hangupButton">Hang Up</button>
</div>
<script>
var localStream, localPeerConnection, remotePeerConnection;
var localVideo = document.getElementById("localVideo");
var remoteVideo = document.getElementById("remoteVideo");
var startButton = document.getElementById("startButton");
var callButton = document.getElementById("callButton");
var hangupButton = document.getElementById("hangupButton");
startButton.disabled = false;
callButton.disabled = true;
hangupButton.disabled = true;
startButton.onclick = start;
callButton.onclick = call;
hangupButton.onclick = hangup;
function trace(text) {
console.log((performance.now() / 1000).toFixed(3) + ": " + text);
}
function gotStream(stream){
trace("Received local stream");
localVideo.src = URL.createObjectURL(stream);
localStream = stream;
callButton.disabled = false;
}
function start() {
trace("Requesting local stream");
startButton.disabled = true;
getUserMedia({audio:true, video:true}, gotStream,
function(error) {
trace("getUserMedia error: ", error);
});
}
function call() {
callButton.disabled = true;
hangupButton.disabled = false;
trace("Starting call");
if (localStream.getVideoTracks().length > 0) {
trace('Using video device: ' + localStream.getVideoTracks()[0].label);
}
if (localStream.getAudioTracks().length > 0) {
trace('Using audio device: ' + localStream.getAudioTracks()[0].label);
}
var servers = null;
localPeerConnection = new RTCPeerConnection(servers);
trace("Created local peer connection object localPeerConnection");
localPeerConnection.onicecandidate = gotLocalIceCandidate;
remotePeerConnection = new RTCPeerConnection(servers);
trace("Created remote peer connection object remotePeerConnection");
remotePeerConnection.onicecandidate = gotRemoteIceCandidate;
remotePeerConnection.onaddstream = gotRemoteStream;
localPeerConnection.addStream(localStream);
trace("Added localStream to localPeerConnection");
localPeerConnection.createOffer(gotLocalDescription,handleError);
}
function gotLocalDescription(description){
localPeerConnection.setLocalDescription(description);
trace("Offer from localPeerConnection: \n" + description.sdp);
remotePeerConnection.setRemoteDescription(description);
remotePeerConnection.createAnswer(gotRemoteDescription,handleError);
}
function gotRemoteDescription(description){
remotePeerConnection.setLocalDescription(description);
trace("Answer from remotePeerConnection: \n" + description.sdp);
localPeerConnection.setRemoteDescription(description);
}
function hangup() {
trace("Ending call");
localPeerConnection.close();
remotePeerConnection.close();
localPeerConnection = null;
remotePeerConnection = null;
hangupButton.disabled = true;
callButton.disabled = false;
}
function gotRemoteStream(event){
remoteVideo.src = URL.createObjectURL(event.stream);
trace("Received remote stream");
}
function gotLocalIceCandidate(event){
if (event.candidate) {
remotePeerConnection.addIceCandidate(new RTCIceCandidate(event.candidate));
trace("Local ICE candidate: \n" + event.candidate.candidate);
}
}
function gotRemoteIceCandidate(event){
if (event.candidate) {
localPeerConnection.addIceCandidate(new RTCIceCandidate(event.candidate));
trace("Remote ICE candidate: \n " + event.candidate.candidate);
}
}
function handleError(){}
</script>
</section>
</main>
<footer role="contentinfo">copyright</footer>
</body>
</html>