updated player for deploy from server
This commit is contained in:
@@ -74,7 +74,7 @@ def ensure_authenticated(config):
|
||||
# Use HTTPS for IP addresses
|
||||
server_url = f'https://{server_ip}:{port}' if port else f'https://{server_ip}'
|
||||
else:
|
||||
server_url = f'http://{server_ip}:{port}'
|
||||
server_url = f'http://{server_ip}:{port}' if port else f'http://{server_ip}'
|
||||
else:
|
||||
# For domain names, use HTTPS by default
|
||||
if use_https:
|
||||
|
||||
+8
-2
@@ -640,6 +640,7 @@ class SettingsPopup(Popup):
|
||||
|
||||
# Populate current values
|
||||
self.ids.server_input.text = self.player.config.get('server_ip', 'localhost')
|
||||
self.ids.port_input.text = str(self.player.config.get('port', ''))
|
||||
self.ids.screen_input.text = self.player.config.get('screen_name', 'kivy-player')
|
||||
self.ids.quickconnect_input.text = self.player.config.get('quickconnect_key', '1234567')
|
||||
self.ids.orientation_input.text = self.player.config.get('orientation', 'Landscape')
|
||||
@@ -723,7 +724,7 @@ class SettingsPopup(Popup):
|
||||
server_ip = self.ids.server_input.text.strip()
|
||||
screen_name = self.ids.screen_input.text.strip()
|
||||
quickconnect = self.ids.quickconnect_input.text.strip()
|
||||
port = self.player.config.get('port', '443')
|
||||
port = self.ids.port_input.text.strip() or self.player.config.get('port', '')
|
||||
use_https = self.player.config.get('use_https', True)
|
||||
verify_ssl = self.player.config.get('verify_ssl', True)
|
||||
|
||||
@@ -741,7 +742,11 @@ class SettingsPopup(Popup):
|
||||
server_url = f"{server_ip}:{port}"
|
||||
else:
|
||||
protocol = "https" if use_https else "http"
|
||||
server_url = f"{protocol}://{server_ip}:{port}"
|
||||
if ':' in server_ip:
|
||||
# server_ip already contains a port (e.g. 192.168.0.230:8080)
|
||||
server_url = f"{protocol}://{server_ip}"
|
||||
else:
|
||||
server_url = f"{protocol}://{server_ip}:{port}" if port else f"{protocol}://{server_ip}"
|
||||
|
||||
Logger.info(f"SettingsPopup: Testing connection to {server_url} (HTTPS: {use_https}, Verify SSL: {verify_ssl})")
|
||||
|
||||
@@ -875,6 +880,7 @@ class SettingsPopup(Popup):
|
||||
"""Save configuration and close popup"""
|
||||
# Update config
|
||||
self.player.config['server_ip'] = self.ids.server_input.text
|
||||
self.player.config['port'] = self.ids.port_input.text.strip()
|
||||
self.player.config['screen_name'] = self.ids.screen_input.text
|
||||
self.player.config['quickconnect_key'] = self.ids.quickconnect_input.text
|
||||
self.player.config['orientation'] = self.ids.orientation_input.text
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"hostname": "rpi-tvcanba1",
|
||||
"auth_code": "LhfERILw4cFxejhbIUuQ72QddisRgHMAm7kUSty64LA",
|
||||
"hostname": "rpi-Receptie",
|
||||
"auth_code": "BrJrGzX_IT9oP_Lfke8Qgo4sDjMc49T1EhSnWmKKpDM",
|
||||
"player_id": 1,
|
||||
"player_name": "TVacasa",
|
||||
"player_name": "Receptie TV",
|
||||
"playlist_id": 1,
|
||||
"orientation": "Landscape",
|
||||
"authenticated": true,
|
||||
"server_url": "https://192.168.0.121:443"
|
||||
"server_url": "http://192.168.0.159:8080"
|
||||
}
|
||||
@@ -382,6 +382,30 @@
|
||||
write_tab: False
|
||||
on_touch_down: root.on_input_touch(self, args[1]) if self.collide_point(*args[1].pos) else None
|
||||
|
||||
# Server port
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
size_hint_y: None
|
||||
height: dp(40)
|
||||
spacing: dp(10)
|
||||
|
||||
Label:
|
||||
text: 'Port:'
|
||||
size_hint_x: 0.3
|
||||
text_size: self.size
|
||||
halign: 'left'
|
||||
valign: 'middle'
|
||||
|
||||
TextInput:
|
||||
id: port_input
|
||||
size_hint_x: 0.7
|
||||
multiline: False
|
||||
font_size: sp(14)
|
||||
hint_text: '80 or 8080 (leave empty for default)'
|
||||
input_filter: 'int'
|
||||
write_tab: False
|
||||
on_touch_down: root.on_input_touch(self, args[1]) if self.collide_point(*args[1].pos) else None
|
||||
|
||||
# Screen name
|
||||
BoxLayout:
|
||||
orientation: 'horizontal'
|
||||
|
||||
Reference in New Issue
Block a user