From 34c03f5eff6aa63917b3ab74cc69ce80691e8f41 Mon Sep 17 00:00:00 2001
From: ulrich <ulrich@ulrich-vaio>
Date: Mon, 26 Apr 2021 21:52:10 +0000
Subject: [PATCH] Weiterspielen repariert

---
 www/ui/js/app.js |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/www/ui/js/app.js b/www/ui/js/app.js
index 691f93c..af2c49d 100644
--- a/www/ui/js/app.js
+++ b/www/ui/js/app.js
@@ -358,9 +358,7 @@
       self.addEvtListener('#pause-btn', 'click', function() {
         self.kommando('pause');
       });
-      self.addEvtListener('#weiter-btn', 'click', function() {
-        self.kommando('weiter');
-      });
+      self.addEvtListener('#weiter-btn', 'click', self.weiter);
 
       self.addEvtListener('#hier-btn', 'click', self.hier_spielen);
       
@@ -408,14 +406,14 @@
       var titel = self.titelErmitteln(document.querySelector(".selected"));
       var playername = document.querySelector('#abspieler').value;
       console.log('plname: ' + playername + ' url: ' + titel.katalogUrl + titel.pfad + titel.name);
-      self.http_post('../api/strg/' + playername + '/titel', JSON.stringify(titel), function(responseText) {
+      self.http_post('../api/strg/' + playername + '/play/titel', JSON.stringify(titel), function(responseText) {
         self.meldung_mit_timeout(responseText, 1500);
       });   
     } else if(bereichName === 'Livestream-Auswahl') {
       var streamName = document.querySelector(".selected").textContent;
       var playername = document.querySelector('#abspieler').value;
       var stream = new Livestream(streamName, '-');
-      self.http_post('../api/strg/' + playername + '/stream', JSON.stringify(stream), function(responseText) {
+      self.http_post('../api/strg/' + playername + '/play/stream', JSON.stringify(stream), function(responseText) {
         self.meldung_mit_timeout(responseText, 1500);
       });   
     } else {
@@ -430,6 +428,18 @@
     }
   };
   
+  this.weiter = function() {
+    var bereichName = document.querySelector('.bereich-name').textContent;
+    if(bereichName === '') {
+      var titel = self.titelErmitteln(document.querySelector(".selected"));
+      var playername = document.querySelector('#abspieler').value;
+      console.log('plname: ' + playername + ' url: ' + titel.katalogUrl + titel.pfad + titel.name);
+      self.http_post('../api/strg/' + playername + '/weiter/titel', JSON.stringify(titel), function(responseText) {
+        self.meldung_mit_timeout(responseText, 1500);
+      });   
+    }
+  };
+  
   this.kommando = function(kommando) {
     var abs = document.querySelector('#abspieler').value;
     self.http_get('../api/strg/' + abs + '/' + kommando, function(responseText) {

--
Gitblit v1.9.3