|
1 | 1 | from cefpython3 import cefpython as cef |
2 | 2 | import ctypes |
| 3 | +import json |
| 4 | +try: |
| 5 | + registry_file = open("../../registry.json", "r") |
| 6 | +except FileNotFoundError: |
| 7 | + registry_file = open("registry.json", "r") |
| 8 | +REGISTRY = json.load(registry_file) |
| 9 | +registry_file.close() |
| 10 | +try: |
| 11 | + general_data_file = open("../../general_data.json", "r") |
| 12 | +except FileNotFoundError: |
| 13 | + general_data_file = open("general_data.json", "r") |
| 14 | +general_data = json.load(general_data_file) |
| 15 | + |
| 16 | +current_user = general_data["last_connected_user"] |
3 | 17 |
|
4 | 18 | try: |
5 | 19 | import tkinter as tk |
@@ -39,9 +53,11 @@ def launch(frame, URL, **settings): |
39 | 53 | sys.excepthook = cef.ExceptHook # To shutdown all CEF processes on error |
40 | 54 | # Tk must be initialized before CEF otherwise fatal error (Issue #306) |
41 | 55 | app = MainFrame(frame, URL) |
| 56 | + if not "cache_path" in settings.keys(): |
| 57 | + settings["cache_path"] = f"ROOT/{REGISTRY['USERS_FOLDER']}/{current_user}/{REGISTRY['USERDATA_NAME']}" |
42 | 58 | if MAC: |
43 | 59 | settings["external_message_pump"] = True |
44 | | - cef.Initialize(settings=settings) |
| 60 | + cef.Initialize(settings=settings, switches={"enable-media-stream": True}) |
45 | 61 |
|
46 | 62 | class MainFrame(tk.Frame): |
47 | 63 | def __init__(self, frame, URL): |
|
0 commit comments