Skip to content

Commit

Permalink
Always use external web client.
Browse files Browse the repository at this point in the history
  • Loading branch information
iwalton3 committed Jun 6, 2024
1 parent 3cb0d4a commit 1976274
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 147 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
brew install ninja mpv qt@5 || true
- name: Release build
run: |
./download_webclient.sh
mkdir build
sed -i '' 's|await loadScript('\''qrc:///qtwebchannel/qwebchannel.js'\'');|document.body.style.overscrollBehavior = "none";&|g' native/nativeshell.js
cd build
cmake -GNinja -DQTROOT=/usr/local/opt/qt@5 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=output ..
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
brew install ninja mpv qt@5 || true
- name: Release build
run: |
./download_webclient.sh
mkdir build
sed -i '' 's|await loadScript('\''qrc:///qtwebchannel/qwebchannel.js'\'');|document.body.style.overscrollBehavior = "none";&|g' native/nativeshell.js
cd build
cmake -GNinja -DQTROOT=/opt/homebrew/opt/qt@5 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=output ..
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
modules: "qtwebengine"
- name: Install dependencies
run: |
./download_webclient.sh
mkdir build
curl -L https://aka.ms/vs/17/release/vc_redist.x64.exe > vc_redist.x64.exe
sed -i 's#C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Redist\\MSVC\\v142\\vcredist_x64.exe#'"$(readlink -f vc_redist.x64.exe | sed 's#/\([a-z]\)/#\1:\\#g' | tr '/' '\\' | sed 's/\\/\\\\/g')#g" bundle/win/Bundle.wxs
curl -L https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip > ninja.zip
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
modules: "qtwebengine"
- name: Install dependencies
run: |
./download_webclient.sh
mkdir build
curl -L https://aka.ms/vs/17/release/vc_redist.x86.exe > vc_redist.x86.exe
sed -i 's#C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Redist\\MSVC\\v142\\vcredist_x64.exe#'"$(readlink -f vc_redist.x86.exe | sed 's#/\([a-z]\)/#\1:\\#g' | tr '/' '\\' | sed 's/\\/\\\\/g')#g" bundle/win/Bundle.wxs
curl -L https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip > ninja.zip
Expand Down
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ Downloads:
- [Flathub (Linux)](https://flathub.org/apps/details/com.github.iwalton3.jellyfin-media-player)

Related Documents:
- Web client: https://repo.jellyfin.org/releases/server/portable/versions/stable/web/
- Note: If you do not provide the web client, the application will use a fallback UI where the user must select a server which has a web client.
- Web client: Application uses server-provided web client.
- Web client integration documentation: [for-web-developers.md](https://github.com/jellyfin/jellyfin-media-player/blob/master/for-web-developers.md)
- API Docs in [client-api.md](https://github.com/jellyfin/jellyfin-media-player/blob/master/client-api.md)
- Tip: For help building, look at the GitHub Actions file!
Expand Down Expand Up @@ -50,7 +49,7 @@ sudo ldconfig
cd ~/jmp/
git clone https://github.com/jellyfin/jellyfin-media-player.git
cd jellyfin-media-player
./download_webclient.sh
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr/local/ -G Ninja ..
ninja
Expand Down Expand Up @@ -83,7 +82,7 @@ sudo ldconfig
cd ~/jmp/
git clone https://github.com/jellyfin/jellyfin-media-player.git
cd jellyfin-media-player/
./download_webclient.sh
mkdir build
cd build/
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr/local/ ..
make -j`nproc`
Expand Down Expand Up @@ -113,7 +112,7 @@ You need to run these commands in git bash.
```bash
git clone https://github.com/jellyfin/jellyfin-media-player
cd jellyfin-media-player
./download_webclient.sh
mkdir build
cd build
```

Expand All @@ -135,7 +134,7 @@ Then run the following commands (replace <QT_DIR> with your QT installation loca

```bash
brew install mpv ninja
./download_webclient.sh
mkdir build
cd build
cmake -GNinja -DQTROOT=<QT_DIR> -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=output ..
ninja install
Expand Down
15 changes: 0 additions & 15 deletions debian-webclient-rules

This file was deleted.

1 change: 0 additions & 1 deletion deployment/build.debian
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ set -o xtrace

# move to source directory
pushd ${SOURCE_DIR}
cp debian-webclient-rules ./debian/rules

# install deps
echo y | mk-build-deps -i
Expand Down
75 changes: 0 additions & 75 deletions download_webclient.sh

This file was deleted.

4 changes: 1 addition & 3 deletions for-web-developers.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ Current Settings:
- `checkForUpdates: boolean`: Allows user to disable update check plugin script.
- This has no effect if you don't use the update script.
- `enableInputRepeat: boolean`: Allows disabling repeating of control inputs.
- `forceExternalWebclient: boolean`: Allows the user to connect to external webclients even if the bundled one is available.
- This has not landed in a released version yet.
- `userWebClient: string`: Hidden option. Set it back to an empty string to allow the user to select a different webclient path.
- Plugins Section (`plugins`):
- `skipintro: boolean`: Enables or disabled the plugin. You likely won't use this.
Expand Down Expand Up @@ -196,7 +194,7 @@ Current Settings:
- `aspect: string enum`: Allows control of aspect ratio. The default is `normal`.
- Options: `normal`, `zoom`, `force_4_3`, `force_16_9`, `force_16_9_if_4_3`, `stretch`, `noscaling`, `custom`
- Subtitle Section (`subtitles`):
- `ass_scale_border_and_shadow`: Controls whether or not ASS subtitles scale their border and shadow with the video resolution. Default `true`
- `ass_scale_border_and_shadow`: Controls whether or not ASS subtitles scale their border and shadow with the video resolution. Default `true`
- `ass_style_override: string enum`: Controls whether user style override should be applied to ASS subtitles. Default: ``
- Provided options: [see enum](https://github.com/jellyfin/jellyfin-media-player/blob/7d5943becc1ca672d599887cac9107836c38d337/resources/settings/settings_description.json#L412-L419)
- `placement: string enum`: Controls where subtitles are displayed on the screen. Default: ``
Expand Down
6 changes: 0 additions & 6 deletions resources/settings/settings_description.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,6 @@
"default": false,
"platforms": [ "linux" ]
},
{
"value": "forceExternalWebclient",
"display_name": "Force External Web Client",
"help": "Allows the user to connect to external webclients even if the bundled one is available.",
"default": false
},
{
"value": "userWebClient",
"default": "",
Expand Down
6 changes: 0 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ endif()
set(RESOURCE_ROOT .)
if(APPLE)
set(RESOURCE_ROOT Resources)
if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/../dist/)
add_resources(TARGET ${MAIN_TARGET} SOURCES ${CMAKE_CURRENT_BINARY_DIR}/../dist/ DEST ${RESOURCE_ROOT}/web-client/desktop)
endif()
add_resources(TARGET ${MAIN_TARGET} SOURCES ${CMAKE_SOURCE_DIR}/native/ DEST ${RESOURCE_ROOT}/web-client/extension)
endif()

Expand All @@ -122,9 +119,6 @@ if(NOT APPLE)
install(FILES ${loc}/qtwebengine_devtools_resources.pak DESTINATION resources)
endif()
endforeach()
if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/../dist/)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../dist/ DESTINATION ${INSTALL_RESOURCE_DIR}/web-client/desktop)
endif()
install(DIRECTORY ${CMAKE_SOURCE_DIR}/native/ DESTINATION ${INSTALL_RESOURCE_DIR}/web-client/extension)
endif()

Expand Down
30 changes: 1 addition & 29 deletions src/settings/SettingsComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -739,28 +739,6 @@ bool SettingsComponent::resetAndSaveOldConfiguration()
return settingsFile.rename(Paths::dataDir("jellyfinmediaplayer.conf.old"));
}


/////////////////////////////////////////////////////////////////////////////////////////
bool SettingsComponent::isUsingExternalWebClient()
{
QString url;

url = SettingsComponent::Get().value(SETTINGS_SECTION_PATH, "startupurl_desktop").toString();

if (url == "bundled")
{
auto path = Paths::webClientPath("desktop");
QFileInfo check_file(path);
if (SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "forceExternalWebclient").toBool() ||
!(check_file.exists() && check_file.isFile())) {
// use built-in fallback
return true;
}
}

return false;
}

/////////////////////////////////////////////////////////////////////////////////////////
QString SettingsComponent::getWebClientUrl(bool desktop)
{
Expand All @@ -770,13 +748,7 @@ QString SettingsComponent::getWebClientUrl(bool desktop)

if (url == "bundled")
{
auto path = Paths::webClientPath("desktop");
QFileInfo check_file(path);
if (SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "forceExternalWebclient").toBool() ||
!(check_file.exists() && check_file.isFile())) {
// use built-in fallback
path = Paths::webExtensionPath() + "find-webclient.html";
}
auto path = Paths::webExtensionPath() + "find-webclient.html";

url = "file:///" + path;
}
Expand Down
1 change: 0 additions & 1 deletion src/settings/SettingsComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ class SettingsComponent : public ComponentBase
Q_INVOKABLE QVariantList settingDescriptions();
Q_INVOKABLE QString getWebClientUrl(bool desktop);
Q_INVOKABLE QString getExtensionPath();
Q_INVOKABLE bool isUsingExternalWebClient();
Q_INVOKABLE QString getClientName();
Q_INVOKABLE bool ignoreSSLErrors();
Q_INVOKABLE bool autodetectCertBundle();
Expand Down
2 changes: 1 addition & 1 deletion src/ui/webview.qml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ KonvergoWindow
settings.errorPageEnabled: false
settings.localContentCanAccessRemoteUrls: true
settings.localContentCanAccessFileUrls: true
settings.allowRunningInsecureContent: components.settings.isUsingExternalWebClient()
settings.allowRunningInsecureContent: true
settings.playbackRequiresUserGesture: false
profile.httpUserAgent: components.system.getUserAgent()
url: mainWindow.webUrl
Expand Down

0 comments on commit 1976274

Please sign in to comment.