feat(share): a link's address says what it opens
A video stays on /watch/, anything else is given out on /file/ and a folder on /folder/. The token is the whole key, so every path opens every link and the links already sent keep working. The new paths are kept out of search indexes like /watch/, boot the player alone, and the unfurl card calls a file a file.
This commit is contained in:
@@ -24,6 +24,20 @@ afterEach(() => {
|
||||
localStorage.clear();
|
||||
});
|
||||
|
||||
describe("WatchPage share paths", () => {
|
||||
it.each(["/watch/tok-p", "/file/tok-p", "/folder/tok-p", "/file/tok-p/extra"])(
|
||||
"reads the token off %s",
|
||||
async (path) => {
|
||||
window.history.replaceState({}, "", path);
|
||||
mockMeta({ needs_password: false, audio: false, file_url: "/f.mp4", title: "A clip" });
|
||||
render(<WatchPage />);
|
||||
await waitFor(() =>
|
||||
expect(fetch).toHaveBeenCalledWith("/api/public/watch/tok-p", expect.anything()),
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
describe("WatchPage background play", () => {
|
||||
it("hands its <video> to the background-play hook, so Brave iOS keeps it playing", async () => {
|
||||
window.history.replaceState({}, "", "/watch/tok-bg");
|
||||
|
||||
Reference in New Issue
Block a user