Commit 207435ec authored by Steve Johnson's avatar Steve Johnson

first commit

parents
CACHE MANIFEST
# Cache manifest version 1.0
CACHE
#no cache
NETWORK
*
\ No newline at end of file
<!--
Copyright (C) 2014 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html>
<html>
<head>
<html manifest="cache.manifest">
<style type="text/css">
body {
overflow:hidden;
background-color:#000000;
}
div {
font-weight:bold;
font-family:Verdana, Geneva, sans-serif;
color:#FFFFFF;
text-align:center;
}
#splash {
height:720PX;
width:1280PX;
xborder:0px solid silver;
display: table-cell;
vertical-align:middle;
background-color:#000000;
background-image: url('mseLogo.png');
background-position: center;
background-repeat: no-repeat;
font-size:20px;
position: absolute;
top: 0;
left: 0;
}
#container {
height:720PX;
width:1280PX;
position: absolute;
top: 0;
left: 0;
background-color: black;
font-size:20px;
}
#containerFrame
{
width: 100%;
height: 100%;
min-width: 100%;
min-height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
border: none;
}
</style>
<title>Cast MSE</title>
</head>
<body>
<div id="container">MSE Container</div>
<div id="splash"></div>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="//www.gstatic.com/cast/sdk/libs/receiver/2.0.0/cast_receiver.js"></script>
<script type="text/javascript">
window.onload = function() {
cast.receiver.logger.setLevelValue(0);
window.castReceiverManager = cast.receiver.CastReceiverManager.getInstance();
console.log('Starting Receiver Manager');
// handler for the 'ready' event
castReceiverManager.onReady = function(event) {
console.log('Received Ready event: ' + JSON.stringify(event.data));
window.castReceiverManager.setApplicationState("Application status is ready...");
};
// handler for 'senderconnected' event
castReceiverManager.onSenderConnected = function(event) {
console.log('Received Sender Connected event: ' + event.data);
console.log(window.castReceiverManager.getSender(event.data).userAgent);
};
// handler for 'senderdisconnected' event
castReceiverManager.onSenderDisconnected = function(event) {
console.log('Received Sender Disconnected event: ' + event.data);
//if (window.castReceiverManager.getSenders().length == 0) {
window.close();
//}
};
// handler for 'systemvolumechanged' event
castReceiverManager.onSystemVolumeChanged = function(event) {
console.log('Received System Volume Changed event: ' + event.data['level'] + ' ' + event.data['muted']);
};
// create a CastMessageBus to handle messages for a custom namespace
window.messageBus = window.castReceiverManager.getCastMessageBus('urn:x-cast:com.cablelabs.cast.mse.control');
// handler for the CastMessageBus message event
window.messageBus.onMessage = function(event) {
try {
var msgObject = JSON.parse(event.data);
if (msgObject.command === 'launch') {
//displayText("launching url: "+msgObject.url);
/* Too choppy
var opacity = 1;
var timer = setInterval(function(){
opacity -= .050;
if (opacity <= 0) {
opacity = 0;
clearInterval(timer);
}
}, 30);
$("#splash").css({ opacity: opacity });
*/
console.log("Received launch command: "+msgObject.url);
$('#container').html("<iframe id='containerFrame' src='"+msgObject.url+"'></iframe>");
$('#containerFrame').load(function(){
$("#splash").css({ opacity: 0 });
});
}
else if (msgObject.command === 'close') {
console.log("Received close command.");
window.close();
}
else {
console.log("Unknown command: "+event.data);
}
return;
}
catch(e) {
console.log("failed to process message: "+e);
console.log("message: \n"+event.data);
}
console.log('Message [' + event.senderId + ']: ' + event.data);
// display the message from the sender
displayText(event.data);
// inform all senders on the CastMessageBus of the incoming message event
// sender message listener will be invoked
window.messageBus.send(event.senderId, event.data);
}
// initialize the CastReceiverManager with an application status message
window.castReceiverManager.start({statusText: "Application is starting"});
console.log('Receiver Manager started');
};
// utility function to display the text message in the input field
function displayText(text) {
console.log(text);
document.getElementById("splash").innerHTML=text;
window.castReceiverManager.setApplicationState(text);
};
</script>
</body>
</html>
\ No newline at end of file
//var castNamespace = 'urn:x-cast:com.cablelabs.cast.mse.control';
var castNamespace = 'urn:x-cast:com.google.cast.sample.helloworld';
<!--
Copyright (C) 2014 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body {
overflow:hidden;
}
div{
height:720PX;
width:1280PX;
text-align:center;
border:0px solid silver;
display: table-cell;
vertical-align:middle;
color:#FFFFFF;
background-color:#000000;
background-image: url('mseLogo.png');
background-position: center;
background-repeat: no-repeat;
font-weight:bold;
font-family:Verdana, Geneva, sans-serif;
font-size:40px;
}
</style>
<title>Cast MSE</title>
</head>
<body>
<DIV id="splash"></DIV>
<script type="text/javascript" src="//www.gstatic.com/cast/sdk/libs/receiver/2.0.0/cast_receiver.js"></script>
<script type="text/javascript" src="msecast.js"></script>
<script type="text/javascript">
window.onload = function() {
cast.receiver.logger.setLevelValue(0);
window.castReceiverManager = cast.receiver.CastReceiverManager.getInstance();
console.log('Starting Receiver Manager');
// handler for the 'ready' event
castReceiverManager.onReady = function(event) {
console.log('Received Ready event: ' + JSON.stringify(event.data));
window.castReceiverManager.setApplicationState("Waiting for MSE Container Load...");
};
// handler for 'senderconnected' event
castReceiverManager.onSenderConnected = function(event) {
console.log('Received Sender Connected event: ' + event.data);
console.log(window.castReceiverManager.getSender(event.data).userAgent);
};
// handler for 'senderdisconnected' event
castReceiverManager.onSenderDisconnected = function(event) {
console.log('Received Sender Disconnected event: ' + event.data);
if (window.castReceiverManager.getSenders().length == 0) {
window.close();
}
};
// handler for 'systemvolumechanged' event
castReceiverManager.onSystemVolumeChanged = function(event) {
console.log('Received System Volume Changed event: ' + event.data['level'] + ' ' +
event.data['muted']);
};
// create a CastMessageBus to handle messages for a custom namespace
window.messageBus =
window.castReceiverManager.getCastMessageBus(castNamespace);
// handler for the CastMessageBus message event
window.messageBus.onMessage = function(event) {
console.log('Message [' + event.senderId + ']: ' + event.data);
// display the message from the sender
displayText(event.data);
// inform all senders on the CastMessageBus of the incoming message event
// sender message listener will be invoked
window.messageBus.send(event.senderId, event.data);
}
// initialize the CastReceiverManager with an application status message
window.castReceiverManager.start({statusText: "Application is starting"});
console.log('Receiver Manager started');
};
// utility function to display the text message in the input field
function displayText(text) {
console.log(text);
document.getElementById("message").innerHTML=text;
window.castReceiverManager.setApplicationState(text);
};
</script>
</body>
</html>
\ No newline at end of file
/*
html, body, #wrapper {
height:100%;
width: 100%;
margin: 0;
padding: 0;
border: 0;
}
#wrapper td {
vertical-align: middle;
text-align: center;
}
input {
font-family: "Arial", Arial, sans-serif;
font-size: 40px;
font-weight: bold;
}
.border {
border: 2px solid #cccccc;
border-radius: 5px;
}
.border:focus {
outline: none;
border-color: #8ecaed;
box-shadow: 0 0 5px #8ecaed;
}
*/
body
{
margin: 0;
padding: 0;
overflow: hidden;
border: none;
max-height: 100%;
height: 100%;
xmax-height: 548px;
}
.lnk
{
font-size: 14px;
color: #0B5199;
text-decoration: none;
}
.rcFrame
{
width: 100%;
height: 100%;
min-width: 100%;
min-height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
border: none;
max-height: 568px !important;
}
#remoteContainer
{
margin: 0;
padding: 0;
overflow: hidden;
border: none;
xmax-height: 568px !important;
}
body
{
margin: 0;
padding: 0;
overflow: hidden;
border: none;
}
#helpButton
{
position: absolute;
opacity: .4;
z-index: 500;
xtop: 400px;
xleft: 290px;
}
#helpDialog
{
border-radius: 10px;
xbackground-color: rgba(35, 50, 96, 0.85);
xbackground-color: gray;
xbackground-image: -webkit-gradient(linear, left top, left bottom, from(rgba(150, 150, 170, 0.85)), to(rgba(18, 29, 68, 0.85)), color-stop(0.15, rgba(77, 85, 119, 0.85)), color-stop(0.15, rgba(35, 50, 96, 0.85)));
xbackground-image: linear-gradient(to bottom, rgba(230, 230, 240, 0.85) 0%, rgba(77, 85, 119, 0.85) 15%, rgba(35, 50, 96, 0.85) 15%, rgba(18, 29, 68, 0.85) 100%);
xbackground: #fff;
background: -webkit-gradient(linear, left top, left bottom, from(#fcfcff), to(#dedede));
border: 4px solid #bac1d3;
border-top-color: #eaeaf2;
border-bottom-color: #a9b0c2;
-webkit-box-shadow: 0 3px 2px #000000;
box-shadow: 0 3px 2px #000000;
color: white;
min-height: 200px;
padding: 0;
z-index: 800;
}
#dialogContainer {
border-radius: 8px;
margin: 0;
padding: 0;
border: none;
color: black;
xoverflow: hidden;
xoverflow-y: scroll;
max-height: 400px;
width: 100%;
xbackground-color: yellow;
}
#dialogHeader {
margin-top: 0px;
background: -webkit-gradient(linear, left top, left bottom, from(#4c5cff), to(#1e2ede));
border-top-left-radius: 8px;
border-top-radius-radius: 8px;
padding-top: 8px;
padding-bottom: 8px;
font-size: 125%;
color: white;
}
#dialogContent {
text-align: left;
padding-left: 6px;
padding-right: 6px;
}
#continueButton {
min-width: 60%;
margin-left: 20%;
}
.hidden {
display: none;
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>MSE Sender</title>
<!--meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="viewport" charset="UTF-8" content="width=device-width, initial-scale=1"-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="cache-control" content="no-cache">
<link href="../ext/dojo-release-1.9.2/dojox/mobile/themes/iphone/iphone.css" rel="stylesheet"></link>
<link href="msesender.css" media="screen" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="//www.gstatic.com/cv/js/sender/v1/cast_sender.js"></script>
<script type="text/javascript" src="../ext/dojo-release-1.9.2/dojo/dojo.js" djConfig="parseOnLoad: true"></script>
<script type="text/javascript" src="../js/constants.js"></script>
<script type="text/javascript" src="../js/utility.js"></script>
<script type="text/javascript" src="../js/xhr.js"></script>
<script type="text/javascript" src="../js/url.js"></script>
<script type="text/javascript" src="msesender.js"></script>
<script language="JavaScript" type="text/javascript">
dojo.require("dojox.mobile.parser");
dojo.require("dojox.mobile.SimpleDialog");
dojo.require("dojox.mobile.Button");
dojo.require("dojox.mobile");
dojo.require("dojox.mobile.ScrollableView");
dojo.require("dojo.cookie");
dojo.require("dojo.dom-style");
dojo.require("dojo._base.connect");
dojo.require("dojo._base.window");
dojo.require("dojo.dom-construct");
dojo.requireIf(!dojo.isWebKit, "dojox.mobile.compat");
dojo.addOnLoad(Remote.onLoad);
</script>
</head>
<body>
<img id="helpButton" onclick="Remote.help();" src="../images/help2.png" />
</body>
</html>
\ No newline at end of file
This diff is collapsed.
<!DOCTYPE html>
<html>
<head>
<meta name='copyright' content='CableLabs © 2013. All Rights Reserved'>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="cache-control" content="no-cache">
<title>MSE TV</title>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="../js/utility.js" ></script>
<script type="text/javascript" src="../js/constants.js" ></script>
<script type="text/javascript" src="../js/applicationBridge.js" ></script>
<script type="text/javascript" src="../js/NodeServerConnection.js" ></script>
<script type="text/javascript" src="../js/NodeServerDirectory.js" ></script>
<script type="text/javascript" src="../ext/js/jquery.cookie.js" ></script>
script>
<script type="text/javascript" src="../shared/sc.js" ></script>
<style type="text/css">
/*** The Essential Code ***/
/* This is REQUIRED when using <!DOCTYPE html> when you want full height.*/
html, body {
height:100%;
width: 100%;
}
body {
background-size: 100% 100%;
overflow: hidden;
}
.frame {height: 100%; width: 100%; border: none;}
h1 {font-family:"Arial", "Helvetica", sans-serif; color: #006F67;}
h2 {font-family:"Arial", "Helvetica", sans-serif; color: #006F67;}
</style>
</head>
<body onload='container.onLoad()'>
<div class='frame'>
<iframe id='ifs' class='frame'></iframe>
</div>
</body>
<!-- https://html5.cablelabs.com/mse/shared/sc.html?bid=OTGQX&wsurl=ws://html5.cablelabs.com:1338 -->
</html>
<!--
Copyright (C) 2014 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html>
<html>
<head>
<title>Hello World</title>
<style type="text/css">
html, body, #wrapper {
height:100%;
width: 100%;
margin: 0;
padding: 0;
border: 0;
}
#wrapper td {
vertical-align: middle;
text-align: center;
}
input {
font-family: "Arial", Arial, sans-serif;
font-size: 40px;
font-weight: bold;
}
.border {
border: 2px solid #cccccc;
border-radius: 5px;
}
.border:focus {
outline: none;
border-color: #8ecaed;
box-shadow: 0 0 5px #8ecaed;
}
</style>
<script type="text/javascript" src="//www.gstatic.com/cv/js/sender/v1/cast_sender.js"></script>
<script type="text/javascript">
var applicationID = '40C1105B'; //794B7BBF';
var namespace = 'urn:x-cast:com.google.cast.sample.helloworld';
var session = null;
/**
* Call initialization for Cast
*/
if (!chrome.cast || !chrome.cast.isAvailable) {
setTimeout(initializeCastApi, 1000);
}
/**
* initialization
*/
function initializeCastApi() {
var sessionRequest = new chrome.cast.SessionRequest(applicationID);
var apiConfig = new chrome.cast.ApiConfig(sessionRequest,
sessionListener,
receiverListener);
chrome.cast.initialize(apiConfig, onInitSuccess, onError);
};
/**
* initialization success callback
*/
function onInitSuccess() {
appendMessage("onInitSuccess");
}
/**
* initialization error callback
*/
function onError(message) {
appendMessage("onError: "+JSON.stringify(message));
}
/**
* generic success callback
*/
function onSuccess(message) {
appendMessage("onSuccess: "+message);
}
/**
* callback on success for stopping app
*/
function onStopAppSuccess() {
appendMessage('onStopAppSuccess');
}
/**
* session listener during initialization
*/
function sessionListener(e) {
appendMessage('New session ID:' + e.sessionId);
session = e;
session.addUpdateListener(sessionUpdateListener);
session.addMessageListener(namespace, receiverMessage);
}
/**
* listener for session updates
*/
function sessionUpdateListener(isAlive) {
var message = isAlive ? 'Session Updated' : 'Session Removed';
message += ': ' + session.sessionId;
appendMessage(message);
if (!isAlive) {
session = null;
}
};
/**
* utility function to log messages from the receiver
* @param {string} namespace The namespace of the message
* @param {string} message A message string
*/
function receiverMessage(namespace, message) {
appendMessage("receiverMessage: "+namespace+", "+message);
};
/**
* receiver listener during initialization
*/
function receiverListener(e) {
if( e === 'available' ) {
appendMessage("receiver found");
}
else {
appendMessage("receiver list empty");
}
}
/**
* stop app/session
*/
function stopApp() {
session.stop(onStopAppSuccess, onError);