Forráskód Böngészése

Abort playback when switching modes

Tobias Hieta 8 éve
szülő
commit
68367bf6d1
2 módosított fájl, 10 hozzáadás és 6 törlés
  1. 3 3
      src/ui/KonvergoWindow.cpp
  2. 7 3
      src/ui/webview.qml

+ 3 - 3
src/ui/KonvergoWindow.cpp

@@ -79,9 +79,6 @@ KonvergoWindow::KonvergoWindow(QWindow* parent) :
   connect(&UpdaterComponent::Get(), &UpdaterComponent::downloadComplete,
           this, &KonvergoWindow::showUpdateDialog);
 
-  connect(this, &KonvergoWindow::webDesktopModeChanged,
-          &PlayerComponent::Get(), &PlayerComponent::stop);
-
 #ifdef Q_OS_MAC
   m_osxPresentationOptions = 0;
 #endif
@@ -326,6 +323,8 @@ void KonvergoWindow::updateMainSectionSettings(const QVariantMap& values)
     else if (!oldDesktopMode && newDesktopMode)
       fullscreen = false;
 
+    PlayerComponent::Get().stop();
+
     QTimer::singleShot(0, [=]
     {
       SettingsComponent::Get().setValue(SETTINGS_SECTION_MAIN, "fullscreen", fullscreen);
@@ -333,6 +332,7 @@ void KonvergoWindow::updateMainSectionSettings(const QVariantMap& values)
       m_webDesktopMode = newDesktopMode;
       emit webDesktopModeChanged();
       emit webUrlChanged();
+
       SystemComponent::Get().setCursorVisibility(true);
       updateWindowState();
       notifyScale(size());

+ 7 - 3
src/ui/webview.qml

@@ -189,13 +189,17 @@ KonvergoWindow
       // it take a few moments for the webview to render
       // after it has loaded.
       //
-      if (loadRequest.status == WebEngineView.LoadSucceededStatus)
+      if (loadRequest.status == WebEngineView.LoadStartedStatus)
       {
-        console.log("Loaded web-client successfully from: " + web.url);
+        console.log("WebEngineLoadRequest starting: " + loadRequest.url);
+      }
+      else if (loadRequest.status == WebEngineView.LoadSucceededStatus)
+      {
+        console.log("WebEngineLoadRequest success: " + loadRequest.url);
       }
       else if (loadRequest.status == WebEngineView.LoadFailedStatus)
       {
-        console.log("FAILED TO LOAD web-client successfully from: " + web.url);
+        console.log("WebEngineLoadRequest failure: " + loadRequest.url + " error code: " + loadRequest.errorCode);
         errorLabel.visible = true
         errorLabel.text = "Error loading client, this is bad and should not happen<br>" +
                           "You can try to <a href='reload'>reload</a> or head to our <a href='http://plex.tv/support'>support page</a><br><br>Actual Error: <pre>" +