| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- <?php
- include_once '../auth.php';
- if(!file_exists("data")){
- mkdir("data",0777,true);
- }
- if (isset($_GET['comm']) && isset($_GET['rid'])){
- $rid = $_GET['rid'];
- $rid = explode(",",$rid)[0];
- file_put_contents("data/" . $rid . ".inf",$_GET['comm']);
- echo "DONE";
- exit(0);
- }
- ?>
- <html>
- <head>
- <link rel="stylesheet" href="../script/tocas/tocas.css">
- <script src="../script/tocas/tocas.js"></script>
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
- <script src="../script/jquery.min.js"></script>
- <script src="../script/ao_module.js"></script>
- <link rel="manifest" href="manifest.json">
- <style>
- body{
- background-color:#0c0c0c;
- color:white;
- }
- .white{
- color:white !important;
- }
- </style>
- </head>
- <body>
- <br>
- <div class="ts container">
- <div class="ts white header">
- <i class="options icon"></i>RemotePlay Remote
- <div class="sub white header">Control your remote player here!</div>
- </div>
- <p class="white">Target RemotePlay ID</p>
- <div class="ts basic mini fluid input">
- <select class="ts basic dropdown" id="remoteID" style="background: black;color: white;width: 100%">
- <option>Scanning...</option>
- </select>
- </div>
- <p class="white">Volume Control (Min <--> Max)</p>
- <div class="ts slider">
- <input id="vol" type="range" min="0" max="1" step="0.05" value="0">
- </div>
- <br>
- <div class="ts separated mini buttons">
- <button class="ts basic white button" onClick="play();"><i class="play icon"></i>Play</button>
- <button class="ts basic white button" onClick="pause();"><i class="pause icon"></i>Pause</button>
- <button class="ts basic white button" onClick="bwd();"><i class="backward icon"></i>Backward</button>
- <button class="ts basic white button" onClick="fwd();"><i class="forward icon"></i>Forward</button>
- <button class="ts basic white button" onClick="fbwd();"><i class="fast backward icon"></i>Fast backward</button>
- <button class="ts basic white button" onClick="ffwd();"><i class="fast forward icon"></i>Fast forward</button>
- <button class="ts basic white button" onClick="stop();"><i class="stop icon"></i>Stop</button>
- <button class="ts basic white button" onClick="mute();"><i class="volume off icon"></i>Mute</button>
- <button class="ts basic white button" onClick="reset();"><i class="stop icon"></i>Reset</button>
- </div>
- </div>
- <script>
- var rid = "";
- ao_module_setWindowSize(1000,340);
- $("#vol").on("change",function(){
- sendCommand("setVol",$(this).val());
- });
- $("#remoteID").on("change",function(){
- ao_module_saveStorage("remoteplay","remoteID",$(this).val());
- rid = $(this).val();
- });
- function play(){
- sendCommand("play","");
- }
- function pause(){
- sendCommand("pause","");
- }
- function fwd(){
- sendCommand("fwd","");
- }
- var ffwding = false;
- function ffwd(){
- if(ffwding){
- clearInterval(timer_1);
- ffwding = false;
- $("button").removeAttr("disabled");
- $("#vol").removeAttr("disabled");
- }else{
- timer_1 = setInterval(fwd, 1000);
- ffwding = true;
- $("#vol").attr("disabled","disabled");
- $("button").attr("disabled","disabled");
- $(".fast.forward.icon").parent().removeAttr("disabled");
- }
- }
- function bwd(){
- sendCommand("bwd","");
- }
- var fbwding = false;
- function fbwd(){
- if(fbwding){
- clearInterval(timer_1);
- fbwding = false;
- $("button").removeAttr("disabled");
- $("#vol").removeAttr("disabled");
- }else{
- timer_1 = setInterval(bwd, 1000);
- fbwding = true;
- $("#vol").attr("disabled","disabled");
- $("button").attr("disabled","disabled");
- $(".fast.backward.icon").parent().removeAttr("disabled");
- }
- }
- function stop(){
- sendCommand("stop","");
- }
- function mute(){
- sendCommand("setVol","0");
- $("#vol").val(0);
- }
- function reset(){
- sendCommand("reset","");
- }
- function sendCommand(comm,value){
- var fullcomm = comm + "," + value;
- $.get("remote.php?comm=" + fullcomm + "&rid=" + rid,function(data){
- if (data.includes("ERROR")){
-
- }
- });
- }
- $(document).ready(function(){
- var previousRemoteID = ao_module_getStorage("remoteplay","remoteID");
- $.get("opr.php?opr=scanalive",function(data){
- var obj = JSON.parse(data);
- $("#remoteID").html("");
- $("#remoteID").append($("<option></option>").attr("value", "").text("Not selected"));
- $.each( obj, function( key, value ) {
- $("#remoteID").append($("<option></option>").attr("value", value).text(value));
- });
- $("#remoteID").val("");
- if (previousRemoteID !== undefined && $("#remoteID option[value='" + previousRemoteID + "']").length > 0){
- $("#remoteID").val(previousRemoteID);
- rid = previousRemoteID;
- }
- });
- });
- </script>
- </body>
- </html>
|