Advertisement
martastain

CCG template

Oct 30th, 2020
2,074
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.38 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <meta charset="utf-8">
  5.     <title>WS BRIDGE</title>
  6.     <style>
  7.         html, body {
  8.             background: transparent;
  9.             overflow: hidden;
  10.         }
  11.  
  12.         #debugwindow {
  13.             font-family: monospace;
  14.             position: absolute;
  15.             left: 10%;
  16.             right: 10%;
  17.             bottom: 10%;
  18.             padding: 20px;
  19.             background-color: rgba(0, 0, 0, .9);
  20.             font-size: 36px;
  21.             color: #cccccc;
  22.         }
  23.     </style>
  24. </head>
  25. <body>
  26.     <ul id="debugwindow"></ul>
  27.     <script src="wscaspar.js"></script>
  28.     <script>
  29.  
  30.     var ws_url = "ws://192.168.5.5:9001";
  31.     var started = false;
  32.     var clip = "EMPTY"; // default value - show nothing
  33.  
  34.     function do_amcp(){
  35.         amcp("PLAY 1-1 " + clip + " MIX 25");
  36.     }
  37.  
  38.     play = function(){
  39.         log(">> PLAY")
  40.         do_amcp();
  41.         started = true;
  42.     }
  43.  
  44.     update = function(data){
  45.         var params = parse_params(data);
  46.         log(">> UPDATE " + JSON.stringify(data) );
  47.         if ("clip" in params){
  48.             clip = params["clip"];
  49.             if (started){  // If CG is already playing, switch clip
  50.                 do_amcp();    
  51.             }
  52.         }
  53.     }
  54.  
  55.     stop = function(data){
  56.         log(">> STOP");
  57.         amcp("PLAY 1-1 EMPTY MIX 25");
  58.     }
  59.     </script>
  60. </body>
  61. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement