+
-
+
diff --git a/ADBService.php b/ADBService.php
index b9fb6fc..768c209 100644
--- a/ADBService.php
+++ b/ADBService.php
@@ -1,6 +1,7 @@
executeCommand(' shell input keyevent ' . ADB_KEYCODES[$keyIdentifier]);
}
+
+ public function startApp($appName)
+ {
+ return $this->executeCommand(' shell am start ' . APP_NAMES[$appName]);
+ }
}
\ No newline at end of file
diff --git a/AppNames.php b/AppNames.php
new file mode 100644
index 0000000..71cda97
--- /dev/null
+++ b/AppNames.php
@@ -0,0 +1,11 @@
+ 'com.google.android.youtube.tv',
+ 'plex' => 'com.plexapp.android.app',
+ 'twitch' => 'tv.twitch.android.app',
+ 'netflix' => 'com.netflix.mediaclient'
+);
+
+
+// :(
\ No newline at end of file
diff --git a/execute.php b/execute.php
index fecaa88..19e7cac 100644
--- a/execute.php
+++ b/execute.php
@@ -7,4 +7,10 @@ include_once 'ADBService.php';
$service = new ADBService(ADBService::DEFAULT_HOST);
$service->connect();
-echo json_encode([$service->sendKey($axiosRequest->keyCode)]);
+if (isset($axiosRequest->keyCode)) {
+ echo json_encode([$service->sendKey($axiosRequest->keyCode)]);
+}
+
+if (isset($axiosRequest->appName)) {
+ echo json_encode([$service->startApp($axiosRequest->appName)]);
+}
diff --git a/index.php b/index.php
index 454b0ed..0fdc2d6 100644
--- a/index.php
+++ b/index.php
@@ -41,10 +41,18 @@ $service = new ADBService(ADBService::DEFAULT_HOST);
+
+
+
+
+
+
+
+
= str_replace('already ', '', $service->connect()) ?>
@@ -60,7 +68,16 @@ $service = new ADBService(ADBService::DEFAULT_HOST);
keyCode: key
}).then((response) => {
// console.log(response);
- }).catch((error) => {
+ }).catch((error) => {22
+ console.log(error);
+ })
+ }
+ function startApp(appName) {
+ axios.post('execute.php', {
+ appName: appName
+ }).then((response) => {
+ // console.log(response);
+ }).catch((error) => {22
console.log(error);
})
}
diff --git a/remote.css b/remote.css
index c80b24d..ee92bc1 100644
--- a/remote.css
+++ b/remote.css
@@ -15,4 +15,26 @@
.play-pause-button {
max-height: 0.8em;
margin-bottom: 3px; /* WEIL LUKI SCHAßAUGAT IST */
+}
+
+.plex-button {
+ margin-bottom: 1px;
+ max-height: 14px;
+}
+
+.btn-youtube {
+ background: white;
+ color: red;
+}
+
+.btn-plex {
+ background: #3b3b3b;
+}
+
+.btn-twitch {
+ background: rebeccapurple;
+}
+
+.btn {
+ border-radius: 50px;
}
\ No newline at end of file