DVTuner

From ICELabWiki

Jump to: navigation, search

Contents

[edit] Summary

DVTuner is a Java applet that finds VLC (or DVTS) on the client's computer, and launches it to run a certain video stream. We have the DVTuner source (in email).

[edit] Outcome

[edit] Plans

  • Replace Gurcharan's many "launchfoo.html" files with a single PHP file and informative links.
  • Send a patch to Andrew/Laurie
  • Post source and binary on the RC website
  • Make a build script that compiles & signs automatically.
  • Code clean-up
  • Use differently-named parameters for IP/Port streams and URIs (at the moment, it's just inspecting the address parameter and trying to Do The Rgiht Thing)

[edit] History

  • Got the DVTuner Sources
  • Changed parameter-handling to accept an URI instead of just host/port
  • We've contacted Andrew Lake about the code's license for re-distribution, and he forwarded the message to Laurie Kirchmeier, who did not respond.
  • Added a Rakefile to (maybe) handle compiling & signing.
    • (It doesn't yet notice if keytool needs to run or not, so it just runs it)

[edit] Notes

Source is available at: http://archer.rit.edu/svn/DVTuner/trunk

Additionally, we should:

  • Replace the proliferation of "launch-xx.html" files with a single PHP file, and take URL parameters (like launch-vlc.php?host=10.21.12.12&port=1773). This should be easy with a small Perl or Ruby (with hpricot) script.
    • Stream info grabbed from cis/~gskpop directory and formatted for php launch with a perl script. The PHP below is what we're using for launching.
  • Change that website to use Thickbox (for jQuery) on all such links, just to make it more streamlined.
    • Thickbox apparently runs the PHP twice - once when you open, once when you close. Maybe we should drop it, or find a way to do inline/inpage running of the php.

Alright, this is almost done. Apparently, to be able to use the java search-for-local-files thing, the .jar needs to be signed or else you get an AccessControlException. To sign the jar I had to create a keystore (keytool -genkey -alias (alias) -keypass (keypass) as root) and then sign the jar (jarsigner (jar) (alias)). In fact it follows that I have to sign it every time I recompile!

[edit] Sample Code

[edit] Straight HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
  <title>Loading VLC</title>
</head>
<body>
  <p><font face="Arial, Helvetica, sans-serif" size="3">Loading <b>233.0.73.28</b>
      with <b>VLC...</b></font>
    <applet archive="DVTuner.jar" code="DVTuner.class" width="1" height="1">
      <param name="player" value="vlc">
      <param name="address" value="233.0.73.28">
      <param name="port" value="1234">
    </applet>
  </p>
</body>
</html>

[edit] PHP

<?
$CHANNELS = array();
$CONTENT_TYPE = array("video/dvts" => "DVTS", "video/vlc" => "VLC", "type/other" => "other");
$date = "";
$start = "";
$end="";

//Tuner variables
$player = "";
$address = "";
$port = "";

if($HTTP_GET_VARS["player"] == "vlc" ||$HTTP_GET_VARS["player"] == "dvts"){
  $player = $HTTP_GET_VARS["player"];
  $address = $HTTP_GET_VARS["address"];
  if(is_numeric($HTTP_GET_VARS["port"]))
    $port = $HTTP_GET_VARS["port"];   
}
?>
<html>
<head>
  <title> Loading <? echo strtoupper($player) ?></title>
</head>
<body>
<p><font face="Arial, Helvetica, sans-serif" size="3">Loading <b><? echo $address ?>
</b> with <b><? echo strtoupper($player) ?>
...</b></font> <applet archive="DVTuner.jar" code="DVTuner.class" width="1" height="1">
  <param name="player" value="<? echo $player ?>">
  <param name="address" value="<? echo $address ?>">
  <param name="port" value="<? echo $port ?>">
</applet></p>
</body>
</html>
Personal tools