Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AirPlay and Chromecast support #2872

Merged
merged 49 commits into from
Jul 11, 2023

Conversation

cj12312021
Copy link
Collaborator

Fixes #1978

This pull request adds AirPlay and Chromecast support to the videojs player.

WithoutPants and others added 24 commits July 27, 2022 02:34
* Move graphql generated files to api
* Refactor identify options
* Remove models.StashBoxes
* Move ScraperSource to scraper package
* Rename field strategy enums
* Rename identify.TaskOptions to Options
* Add new txn manager interface
* Add txn management to sqlite
* Rename get to getByID
* Add contexts to repository methods
* Update query builders
* Add context to reader writer interfaces
* Use repository in resolver
* Tighten interfaces
* Tighten interfaces in dlna
* Tighten interfaces in match package
* Tighten interfaces in scraper package
* Tighten interfaces in scan code
* Tighten interfaces on autotag package
* Remove ReaderWriter usage
* Merge database package into sqlite
* Move manual docs
* Move changelog docs
* Add migration notes
* Move changelog to settings
* Add release notes dialog
* Add new changelog
* Restructure data layer part 2 (stashapp#2599)
* Refactor and separate image model
* Refactor image query builder
* Handle relationships in image query builder
* Remove relationship management methods
* Refactor gallery model/query builder
* Add scenes to gallery model
* Convert scene model
* Refactor scene models
* Remove unused methods
* Add unit tests for gallery
* Add image tests
* Add scene tests
* Convert unnecessary scene value pointers to values
* Convert unnecessary pointer values to values
* Refactor scene partial
* Add scene partial tests
* Refactor ImagePartial
* Add image partial tests
* Refactor gallery partial update
* Add partial gallery update tests
* Use zero/null package for null values
* Add files and scan system
* Add sqlite implementation for files/folders
* Add unit tests for files/folders
* Image refactors
* Update image data layer
* Refactor gallery model and creation
* Refactor scene model
* Refactor scenes
* Don't set title from filename
* Allow galleries to freely add/remove images
* Add multiple scene file support to graphql and UI
* Add multiple file support for images in graphql/UI
* Add multiple file for galleries in graphql/UI
* Remove use of some deprecated fields
* Remove scene path usage
* Remove gallery path usage
* Remove path from image
* Move funscript to video file
* Refactor caption detection
* Migrate existing data
* Add post commit/rollback hook system
* Lint. Comment out import/export tests
* Add WithDatabase read only wrapper
* Prepend tasks to list
* Add 32 pre-migration
* Add warnings in release and migration notes
* Add filtering on file count
* Add sorting by file count
* Fix destroy gallery not destroying file
* Re-add minModTime functionality
* Deprecate useFileMetadata and stripFileExtension
* Optimise files post migration
* Decorate moved files. Use first missing file in move
* Include path in thumbnail generation error log
* Fix stash-box draft submission
* Don't destroy files unless deleting
* Call handler for files with no associated objects
* Fix moved zips causing error on scan
* Improve image query performance
* Tune queries
* Fix db generator
* Don't show release notes in setup
* Further tune indexes
* Log when creating screenshot
* Fix large wal file during migration
* Fix migration dropping / from network share paths
* Use cache during migration
* Avoid use of query views
* Use FindMany to find related objects
* Log slow queries
* Add folders to generated files
* Use SlimScene for scene queries
* Include filename in migration error message
* Fix scan options not saving
* Fix duration stat calculation
* Do database txn in same thread. Retry on locked db
* Remove captions from slimscenedata
* Fix tracing
* Use where in instead of individual selects
* Remove scenes_query view
* Remove image query view
* Remove gallery query view
* Use where in for FindMany
* Don't interrupt scanning zip files
* Fix image filesize sort
* Load scene relationships on demand
* Load image relationships on demand
* Load gallery relationships on demand
* Add dataloaden
* Use dataloaders
* Use where in for other find many functions
* Fix scene sorting
* Fix folder-based gallery path sorting
* Fix gallery path filter
* Fix stash-box performer submission
* Fix identify logging
* Remove govet from linter
* Use alternative config file to disable linters that cause out of mem error
* Rollback platform agnostic path storage
* Add release note for database change
* Adjust json schema
* Remove mappings file from export
* Import file/folder support
* Update documentation
* Make gallery filenames unique
* Don't load image files by default
* Don't load gallery files by default
* Don't load scene files by default
* Retry locked transactions forever
* Don't show release notes if config not loaded
* Don't translate path slashes in export
* Return error if multiple rows returned for id
* Add missing LoadFiles calls
* Show id if path is empty
@cj12312021
Copy link
Collaborator Author

I'm not sure why it would be necessary either, but I've gone ahead and added git to the line. Let me know if it helps.

@WithoutPants
Copy link
Collaborator

I can't test this because make docker-build fails with

[2/4] Fetching packages...
error Couldn't find the binary git

If git is actually needed by the new yarn dependencies (not sure why it would be?) then can you add git to the end of docker/build/x86_64/Dockerfile on line 5?

Looks like it's due to this line in yarn.lock:

webcomponents.js "git+https://git@github.com/webcomponents/webcomponentsjs.git#v0.7.24"

This is a dependency of @silvermine/videojs-chromecast@^1.3.4

@WithoutPants
Copy link
Collaborator

Hi, thank you for this feature - really looking forward to it. But I think it should not be enabled by default if it involves a http query to Google on every page load for every user (yes, browser-cache is a thing).

Instead it should be optional to activate like DLNA (at least Chromecast support) and be opt-in - if there is no way to have a local hosted version of the cast_sender.js javascript.

Agree, I don't like the UI hitting an external google URL for the scene player for all users. I think this should be a togglable setting.

@cj12312021
Copy link
Collaborator Author

@JoeSmithStarkers, can you help us test this change one more time when you get a chance?

@cj12312021
Copy link
Collaborator Author

In its current state, Chromecast support in this pull request should be on par with the airplay. However, the big caveat with Chromecast is that the __onGCastApiAvailable flag in cast_sender.js, which loads the remaining necessary resources, is only triggered if the sender is hosted with HTTPS. Since Chromecast also suffers from the HTTPS issues we've seen with airplay, proper Chromecast support is blocked until that issue is resolved. I've noticed that the __onGCastApiAvailable flag does trigger when the URL is localhost, but a Chromecast receiver does not know where to find the video at that URL without some tweaking. Since that is not a typical use case, I didn't see the value in pushing the tweak I wrote to provide the proper IP. I attempted to set up an environment that could enable me to debug the Chromecast connection when sending via HTTPS to get more insight into the cause. However, I have yet to get the environment to work as intended. I may give it another go later.

@WithoutPants WithoutPants removed this from the Version 0.19.0 milestone Jan 29, 2023
@DogmaDragon DogmaDragon added the feature Pull requests that add a new feature label Feb 21, 2023
@JoeSmithStarkers
Copy link
Contributor

Sorry, I've finally got around to testing this on my setup. Chromecast and airplay work well with this feature applied to v0.19.1 custom version that i am running.

My setup includes a reverse proxy, and letsencrypt cert. So i get around all the https issues.

@john-miller-831985
Copy link

It looks like this branch has gone stale. Personally I would really like this feature. Is this something that would be merged if the branch is updated?

@cj12312021
Copy link
Collaborator Author

Sure, I can go ahead and update this branch so it can be merged as is. The HTTPS issue can be resolved later.

@cj12312021
Copy link
Collaborator Author

This branch is no longer stale if there were any plans to merge it as is.

@john-miller-831985
Copy link

I had to update the CUDA dockerfile to get this to build, and even with valid SSL it did not seem to work.

--- a/docker/build/x86_64/Dockerfile-CUDA
+++ b/docker/build/x86_64/Dockerfile-CUDA
@@ -2,7 +2,7 @@
 
 # Build Frontend
 FROM node:alpine as frontend
-RUN apk add --no-cache make
+RUN apk add --no-cache make git
 ## cache node_modules separately
 COPY ./ui/v2.5/package.json ./ui/v2.5/yarn.lock /stash/ui/v2.5/
 WORKDIR /stash

@cj12312021
Copy link
Collaborator Author

Yeah, I mentioned issues with SSL in my earlier post. Both Chromecast and Airplay, even the out-of-the-box airplay support iPhone users have without these changes, don't function properly when using SSL. Airplay users can get around this though, since SSL isn't required for Airplay to work. Chromecast, however does. JoeSmithStarkers seems to have found a way to work around the SSL issues to get Chromecast working which users might consider until the SSL issues get worked out.

@john-miller-831985
Copy link

Makes sense. I misunderstood the error you were discussing above, and thought the issue only occurred on self signed ssl certs, but overall I see real promise in the code on this branch. I just hope it gets to a point where it can be merged.

@WithoutPants WithoutPants merged commit 8e235a2 into stashapp:develop Jul 11, 2023
2 checks passed
WithoutPants added a commit that referenced this pull request Jul 11, 2023
WithoutPants added a commit that referenced this pull request Jul 11, 2023
randemgame added a commit to randemgame/stash that referenced this pull request Jul 12, 2023
commit 67d4f97
Author: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
Date:   Wed Jul 12 11:51:52 2023 +1000

    Multiple scene URLs (stashapp#3852)

    * Add URLs scene relationship
    * Update unit tests
    * Update scene edit and details pages
    * Update scrapers to use urls
    * Post-process scenes during query scrape
    * Update UI for URLs
    * Change urls label

commit 76a4bfa
Author: chickenwingavalanche <138962341+chickenwingavalanche@users.noreply.github.com>
Date:   Tue Jul 11 19:25:24 2023 -0600

    Add keyboard shortcut to toggle video looping in scene player (stashapp#3902)

    * Use shift+L to toggle video looping in scene player

commit 3e810cf
Author: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
Date:   Wed Jul 12 10:53:46 2023 +1000

    Add nil checks in identify (stashapp#3905)

commit c1352f9
Author: NodudeWasTaken <75137537+NodudeWasTaken@users.noreply.github.com>
Date:   Wed Jul 12 02:45:33 2023 +0200

    Safari video height css fix (stashapp#3882)

commit f665aa8
Author: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
Date:   Wed Jul 12 10:38:52 2023 +1000

    Update make target in Dockerfile-CUDA

commit b2b52bc
Author: chickenwingavalanche <138962341+chickenwingavalanche@users.noreply.github.com>
Date:   Tue Jul 11 18:37:46 2023 -0600

    Add missing scene player shortcuts to Help -> Keyboard Shortcuts (stashapp#3903)

    Co-authored-by: chickenwingavalanche <chickenwingavalanche@example.com>

commit 96f2229
Author: DingDongSoLong4 <99329275+DingDongSoLong4@users.noreply.github.com>
Date:   Wed Jul 12 02:05:35 2023 +0200

    Improve Makefile (stashapp#3901)

    * Improve Makefile
    * Make ui targets consistent
    ---------
    Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>

commit 278a064
Author: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
Date:   Tue Jul 11 19:16:22 2023 +1000

    Revert "Add AirPlay and Chromecast support (stashapp#2872)" (stashapp#3898)

    This reverts commit 8e235a2.

commit 0c0ba19
Author: Csaba Maulis <hello@senki.xyz>
Date:   Tue Jul 11 13:54:42 2023 +0800

    Add `-v/--version` flag to print version string (stashapp#3883)

    * Add `-v/--version` flag to print version string

    - Created a new flag `-v/--version` in the command-line interface to display the version number and exit.
    - Moved all version-related functions inside the config package to the new file `manager/config/version.go` to avoid circular dependencies.
    - Added a new `GetVersionString()` function to generate a formatted version string.
    - Updated references to the moved version functions.
    - Updated references in the `Makefile`.

    * Move version embeds to build package

    * Remove githash var

    ---------

    Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>

commit 969af2a
Author: A Ghoul Coder <aghouleditor@protonmail.com>
Date:   Tue Jul 11 07:53:53 2023 +0200

    add phasher (stashapp#3864)

    * add phasher

    A simple `phasher` program that accepts a video file as a command line
    argument and calculates and prints its PHASH.

    The goal of this separate executable is to have a simple way to
    calculate phashes that doesn't depend on a full stash instance so that
    third-party systems and tools can independently generate PHASHes which
    can be used for interacting with stash and stash-box APIs and data.

    Currently `phasher` is built in the default make target along with
    `stash` by simply running `make`.
    Cross-platform targets have not been considered.

    Concurrency is intentionally not implemented because it is simpler to
    use [GNU Parallel](https://www.gnu.org/software/parallel/).
    For example:
    ```
    parallel phasher {} ::: *.mp4
    ```

    * standard dir structure for phasher and separate make target

    The make target still needs to be integrated into the rest of the
    Makefile so it can be built as part of normal releases.

    * phasher: basic usage output and quiet option
    * phasher: allow and process multiple command line arguments
    * phasher: camelCase identifiers
    * phasher: initialize ffmpeg and ffprobe only once

commit cbdd4d3
Author: Flashy78 <90150289+Flashy78@users.noreply.github.com>
Date:   Mon Jul 10 21:37:00 2023 -0700

    Identify: Options to skip multiple results and single name performers (stashapp#3707)

    Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>

commit ff22577
Author: hontheinternet <121332499+hontheinternet@users.noreply.github.com>
Date:   Tue Jul 11 13:32:42 2023 +0900

    Add additional stats to the Stats page (stashapp#3812)

    * Add o_counter, play_duration, play_count, unique_play_count stats

commit 4f0e0e1
Author: hontheinternet <121332499+hontheinternet@users.noreply.github.com>
Date:   Tue Jul 11 13:02:09 2023 +0900

    Allow serving of interactive CSVs directly to Handy (stashapp#3756)

    * allow direct serve interactive CSVs to Handy
    ---------
    Co-authored-by: kermieisinthehouse <kermie@isinthe.house>

commit 8e235a2
Author: CJ <72030708+Teda1@users.noreply.github.com>
Date:   Mon Jul 10 22:47:11 2023 -0500

    Add AirPlay and Chromecast support (stashapp#2872)

    * dynamically load cast_sender.js
    * add https://www.gstatic.com to connectableOrigins
    * Add toggle for chromecast

commit c499c20
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Jul 11 13:40:29 2023 +1000

    Bump semver from 5.7.1 to 5.7.2 in /ui/v2.5 (stashapp#3896)

    Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2.
    - [Release notes](https://github.com/npm/node-semver/releases)
    - [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md)
    - [Commits](npm/node-semver@v5.7.1...v5.7.2)

    ---
    updated-dependencies:
    - dependency-name: semver
      dependency-type: indirect
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit f0d901a
Author: plato178 <137155614+plato178@users.noreply.github.com>
Date:   Tue Jul 11 03:45:20 2023 +0100

    Add codec filters (stashapp#3843)

    * Add video_codec and audio_codec filter criteria
    * Add Audio Codec and Video Codec UI filters

commit 93b41fb
Author: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
Date:   Tue Jul 11 11:53:49 2023 +1000

    Add folder rename detection (stashapp#3817)

commit 5c38836
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Tue Jul 11 11:40:49 2023 +1000

    Bump stylelint from 15.1.0 to 15.10.1 in /ui/v2.5 (stashapp#3889)

    Bumps [stylelint](https://github.com/stylelint/stylelint) from 15.1.0 to 15.10.1.
    - [Release notes](https://github.com/stylelint/stylelint/releases)
    - [Changelog](https://github.com/stylelint/stylelint/blob/main/CHANGELOG.md)
    - [Commits](stylelint/stylelint@15.1.0...15.10.1)

    ---
    updated-dependencies:
    - dependency-name: stylelint
      dependency-type: direct:development
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit cec9195
Author: DingDongSoLong4 <99329275+DingDongSoLong4@users.noreply.github.com>
Date:   Tue Jul 11 03:40:20 2023 +0200

    Fix scene missing flicker on scene page (stashapp#3857)

    * use useLayoutEffect
    * Remove unnecessary nullability in ScenePlayer

commit 0268565
Author: DingDongSoLong4 <99329275+DingDongSoLong4@users.noreply.github.com>
Date:   Tue Jul 11 03:36:57 2023 +0200

    Makefile cleanup (stashapp#3876)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Pull requests that add a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug Report] AirPlay/Casting option not present
8 participants