2023-07-21, 02:37
xbmc.player() stalls right after I stop the video and I end up with a frozen screen. Android Nvidia shield - Code works flawlessly on other platforms. I do not know how to start debugging it!
python:def _play_film(self, urlparam):
"Play the stream corresponding to title."
film = urlparam.split("=")[1]
film = unquote(film)
with self.connect_films_db() as db_con:
c = db_con.cursor()
query = "SELECT player_link FROM films WHERE title = ?"
c.execute(query, (film,))
result = c.fetchone()
if result is not None and len(result) > 0:
player_link = result[0]
scraper = Scraper2()
film_page = scraper.get_film_page_in_a_string(player_link)
films2 = Films2()
mp4_url = films2.mp4_url_link(film_page)
path = mp4_url[0]
listitem = xbmcgui.ListItem(path=path)
req = urllib.request.Request(path)
req.add_header('User-Agent', USER_AGENT)
with urllib.request.urlopen(req) as response:
xbmc.Player().play(response.url)