Skip to content

Instantly share code, notes, and snippets.

@fapestniegd
Created July 5, 2011 15:24
Show Gist options
  • Select an option

  • Save fapestniegd/1065051 to your computer and use it in GitHub Desktop.

Select an option

Save fapestniegd/1065051 to your computer and use it in GitHub Desktop.
# with the AP4J java applet running on 172.17.2.54:7070
################################################################################
# add these to your apache config
ProxyPass /7070/ http://172.17.2.54:7070/
ProxyPassReverse /7070/ http://172.17.2.54:7070/
ProxyRequests On
ProxyVia On
<Proxy http://172.17.2.54:7070/>
Order allow,deny
Allow from all
</Proxy>
################################################################################
# Copy them outside of the java applet for local referencing:
#
cd ${DOCUMENTROOT}
for file in jquery-1.4.4.min.js jquery-ui-1.8.7.custom.css jquery-ui-1.8.7.custom.min.js main.js index.html;do
wget -O "${file}" "http://172.17.2.54:7070/${file}"
done
################################################################################
# change all occurances of /ci in main.js to http://movies/7070/ci
# (movies is a CNAME to 172.17.2.54 on my network, adjust accordingly)
#
diff -ruN ap4j/main.js ap4j.patched/main.js
--- ap4j/main.js 2011-07-05 10:19:47.000000000 -0500
+++ ap4j.patched/main.js 2011-07-05 10:17:38.000000000 -0500
@@ -30,7 +30,7 @@
{
if(!pauseStatusUpdate)
{
- $.getJSON("/ci",
+ $.getJSON("http://movies/7070/ci",
{
t: "4",
d: $('#selectedpd :selected').val()
@@ -48,7 +48,7 @@
{
if(hasStartedPlaying)
{
- $.getJSON("/ci",
+ $.getJSON("http://movies/7070/ci",
{
t: "5",
d: $('#selectedpd :selected').val(),
@@ -65,7 +65,7 @@
$("#playbackslider").slider( 'option', { disabled: true, max: 0, value: 0 } );
- $.getJSON("/ci",
+ $.getJSON("http://movies/7070/ci",
{
t: "2",
d: $('#selectedpd :selected').val(),
@@ -81,7 +81,7 @@
function pause()
{
- $.getJSON("/ci",
+ $.getJSON("http://movies/7070/ci",
{
t: "5",
d: $('#selectedpd :selected').val(),
@@ -95,7 +95,7 @@
function stop()
{
- $.getJSON("/ci",
+ $.getJSON("http://movies/7070/ci",
{
t: "3",
d: $('#selectedpd :selected').val()
@@ -151,7 +151,7 @@
close: dialogClose
});
- $.getJSON('/ci?t=1', function(data)
+ $.getJSON('http://movies/7070/ci?t=1', function(data)
{
var playbackDevices = data.devices;
@@ -237,7 +237,7 @@
function handleScrubSlideDone(event, ui)
{
- $.getJSON("/ci",
+ $.getJSON("http://movies/7070/ci",
{
t: "6",
d: $('#selectedpd :selected').val(),
@@ -252,7 +252,7 @@
function refreshDeviceList()
{
- $.getJSON('/ci?t=1', function(data)
+ $.getJSON('/7070/ci?t=1', function(data)
{
if (data.devices != null && data.devices.length > 0)
{
@@ -275,4 +275,4 @@
$(document).ready(function()
{
refreshDeviceList();
-});
\ No newline at end of file
+});
################################################################################
# Just replace the index.html with something like this: (bonus points, make it a cgi)
#
<html>
<head>
<title>Main Menu</title>
<script type="text/javascript" src="jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="jquery-ui-1.8.7.custom.min.js"></script>
<script type="text/javascript" src="main.js"></script>
<script type="text/javascript">
function loadMovie(url){
var textfield = document.getElementById('video_url');
textfield.value = url;
loadVideoURL('video_url');
}
</script>
<link rel="stylesheet" href="jquery-ui-1.8.7.custom.css">
<style type="text/css">
body { padding: 5px; }
.indentedarea { padding: 10px 10px 10px 25px; }
.boldspan { font-weight: bold; font-size: 110%; padding-bottom: 5px; }
a, a:hover, a:focus, a:active { text-decoration: none; }
.ui-slider .ui-slider-handle { width: 12px; margin-left: -6px; height: 12px; margin-top: 1px; }
#playback_device_selection { padding: 0 10px 10px 0; }
</style>
</head>
<body>
<!-- BEGIN MOVIES -->
<img height='300' src="images/300.jpg" onClick="javascript:loadMovie('http://movies/movies/300.mp4');">
<img height='300' src="images/resident_evil_afterlife.jpg" onClick="javascript:loadMovie('http://movies/movies/resident_evil_afterlife.mp4');">
<img height='300' src="images/lord_of_the_rings_the_two_towers.jpg" onClick="javascript:loadMovie('http://loki.websages.com/The_Two_Towers.mp4');">
<img height='300' src="images/lord_of_the_rings_the_return_of_the_king.jpg" onClick="javascript:loadMovie('http://loki.websages.com/The_Return_of_the_King.mp4');">
<!-- END MOVIES -->
<div class="indentedarea">
<form action="#" id='movieform'>
<input type="hidden" name="video_url" id="video_url" size="30" value=""/>
</form>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment