forked from stashapp/stash
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
99 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
Modification List: | ||
============= | ||
api/routes_scene.go | ||
|
||
func Routes() | ||
r.Route("/{sceneId}", func(r chi.Router) { | ||
// Added | ||
r.Get("/stream/org/*", rs.StreamOrgDirect) | ||
|
||
} | ||
|
||
// Added: | ||
func (rs sceneRoutes) StreamOrgDirect(w http.ResponseWriter, r *http.Request) { | ||
scene := r.Context().Value(sceneKey).(*models.Scene) | ||
// check if it's funscript | ||
aStr := strings.Split(r.RequestURI, ".") | ||
if strings.ToLower(aStr[len(aStr)-1]) == "funscript" { | ||
// it's a funscript request | ||
rs.Funscript(w, r) | ||
return | ||
} | ||
|
||
// return 404 if the scene does not have file | ||
// Primary file method no longer works, only Files.List()[0].Path | ||
Path := scene.Files.List()[0].Path | ||
if Path == "" { | ||
w.WriteHeader(http.StatusNotFound) | ||
return | ||
} | ||
http.ServeFile(w, r, Path) | ||
} | ||
|
||
=========== | ||
ui/v2.5/src/components/Scenes/SceneDetails/ExternalPlayerButton.tsx | ||
|
||
export const ExternalPlayerButton: React.FC<IExternalPlayerButtonProps> = ({ | ||
scene, | ||
}) => { | ||
|
||
const intl = useIntl(); | ||
|
||
|
||
const alwaysShow = true; // Added | ||
|
||
const { paths } = scene; | ||
const { files } = scene; // added | ||
const { path } = files[0]; // added. | ||
|
||
if (!paths || !paths.stream || (!isAndroid && !isAppleDevice && !alwaysShow)) | ||
// moded | ||
return <span />; | ||
|
||
|
||
if (isAndroid) { | ||
const scheme = streamURL.protocol.slice(0, -1); | ||
streamURL.hash = `Intent;action=android.intent.action.VIEW;scheme=${scheme};type=video/mp4;S.title=${encodeURI( | ||
title | ||
)};end`; | ||
streamURL.protocol = "intent"; | ||
url = streamURL.toString(); | ||
} else if (isAppleDevice) { | ||
streamURL.host = "x-callback-url"; | ||
streamURL.port = ""; | ||
streamURL.pathname = "stream"; | ||
streamURL.search = `url=${encodeURIComponent(stream)}`; | ||
streamURL.protocol = "vlc-x-callback"; | ||
url = streamURL.toString(); | ||
} else if (alwaysShow) { | ||
// In all other cases. | ||
|
||
url = stream + "/org/" + encodeURIComponent(file.toString()); // like http://192.168.1.10:9999/scene/123/stream/org/file.mp4 | ||
url2 = url; // for now. Need to fix it for PlayA | ||
streamURL.pathname = "/api/playa/v1/video/" + scene.id; | ||
} | ||
|
||
return ( | ||
<Button | ||
className="minimal px-0 px-sm-2 pt-2" | ||
variant="secondary" | ||
title={intl.formatMessage({ id: "actions.open_in_external_player" })} | ||
> | ||
<a href={url2}> | ||
PlayA | ||
<Icon icon={faExternalLinkAlt} color="white" /> | ||
</a> | ||
<a href={url}> | ||
DeoVR | ||
<Icon icon={faExternalLinkAlt} color="white" /> | ||
</a> | ||
</Button> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters