VideoSkip icon indicating copy to clipboard operation
VideoSkip copied to clipboard

server-side files

Open retracile opened this issue 3 years ago • 9 comments

Thank you for creating this!

I have a home webserver where I can put videoskip.html, and self host .mp4's and .skp's. I'd like to be able to use the served files instead of downloading and uploading, and I'd like to be able to specify that in the URL so I can have a page of clean movie links. Something like <a href="/videoskip.html?videoFile=/videos/my-movie.mp4&skipFile=/videos/my-movie.skp">My movie</a>.

How feasible would that be?

retracile avatar Jun 05 '22 01:06 retracile

You can use the standalone version of VideoSkip if you are viewing the videos in the same machine that hosts them. You can also set up something like a Plex server, but then you'll have to load the skip files separately since Plex does not (yet) integrate with VideoSkip.

I don't know how to do the kind of programming that would be needed so VideoSkip integrates with Plex, but maybe you know someone who does?

On Sat, Jun 4, 2022 at 8:34 PM Eli Carter @.***> wrote:

Thank you for creating this!

I have a home webserver where I can put videoskip.html, and self host .mp4's and .skp's. I'd like to be able to use the served files instead of downloading and uploading, and I'd like to be able to specify that in the URL so I can have a page of clean movie links. Something like My movie http:///videoskip.html?videoFile=/videos/my-movie.mp4&skipFile=/videos/my-movie.skp .

How feasible would that be?

— Reply to this email directly, view it on GitHub https://github.com/fruiz500/VideoSkip/issues/9, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATF25AS4KBILDKRYIBVF2TVNP7Y7ANCNFSM5X4IWXYQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Francisco Ruiz Associate Professor MMAE department Illinois Institute of Technology

PL24wordLok==qualifications veterans speaker coating physically tapes worldsex folder book mostly distinguished shine enemy sticker focusing arena believe zinc baker thoroughly==PL24wordLok https:*//*www.youtube.com http://youtube.com/watch?v=BT_tFXpkUR0

get the PassLok privacy app at: https://passlok.com http://passlok.com

fruiz500 avatar Jun 05 '22 01:06 fruiz500

I'm not using something as fancy as Plex... just apache serving files. I'd be viewing from a laptop using a browser.

retracile avatar Jun 05 '22 03:06 retracile

OK, I'll look into that.

On Sat, Jun 4, 2022 at 10:27 PM Eli Carter @.***> wrote:

I'm not using something as fancy as Plex... just apache serving files. I'd be viewing from a laptop using a browser.

— Reply to this email directly, view it on GitHub https://github.com/fruiz500/VideoSkip/issues/9#issuecomment-1146734055, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATF25HM6KSTF3SP4DLQA33VNQNDFANCNFSM5X4IWXYQ . You are receiving this because you commented.Message ID: @.***>

-- Francisco Ruiz Associate Professor MMAE department Illinois Institute of Technology

PL24wordLok==qualifications veterans speaker coating physically tapes worldsex folder book mostly distinguished shine enemy sticker focusing arena believe zinc baker thoroughly==PL24wordLok https:*//*www.youtube.com http://youtube.com/watch?v=BT_tFXpkUR0

get the PassLok privacy app at: https://passlok.com http://passlok.com

fruiz500 avatar Jun 06 '22 15:06 fruiz500

Ok, I have a proof of concept working: https://github.com/retracile/VideoSkip/tree/url-params That's an ugly, ugly hack, so I don't recommend pulling in those changes. It's intended as a demonstration that "yes, it can be done", nothing more. But it allows a URL of the form https://somehost/videoskip.html?video=/videos/myvideo.mp4&skips=/videos/myvideo.skp, and you can just hit play. To implement this cleanly is going to take a bit of refactoring of the code. Are you open to PRs to do that?

retracile avatar Jun 08 '22 01:06 retracile

I created a pull request (https://github.com/fruiz500/VideoSkip/pull/10) with a cleaner implementation. Feedback welcome.

retracile avatar Jun 18 '22 21:06 retracile

Hi Eli,

I've been quite busy with my promotion case, but I think I'm close to being able to spend time on this. I'm not forgetting you.

On Sat, Jun 18, 2022 at 4:05 PM Eli Carter @.***> wrote:

I created a pull request (#10 https://github.com/fruiz500/VideoSkip/pull/10) with a cleaner implementation. Feedback welcome.

— Reply to this email directly, view it on GitHub https://github.com/fruiz500/VideoSkip/issues/9#issuecomment-1159562846, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATF25G6FMPV2T46FFCG4ITVPY22HANCNFSM5X4IWXYQ . You are receiving this because you commented.Message ID: @.***>

-- Francisco Ruiz Associate Professor MMAE department Illinois Institute of Technology

PL24wordLok==qualifications veterans speaker coating physically tapes worldsex folder book mostly distinguished shine enemy sticker focusing arena believe zinc baker thoroughly==PL24wordLok https:*//*www.youtube.com http://youtube.com/watch?v=BT_tFXpkUR0

get the PassLok privacy app at: https://passlok.com http://passlok.com

fruiz500 avatar Jun 19 '22 17:06 fruiz500

Hello Eli,

I finally had some time to check your implementation. Rather than a local server, I put the files on the VideoSkip server. These are the URLs:

test video: https://videoskip.org/files/ukulele.mp4 skip file: https://videoskip.org/files/ukulele.skp

Then I put a local copy of your VideoSkip in my Downloads folder and write the following on the address bar:

file:///Users/myName/Downloads/videoskip.html?video= https://videoskip.org/files/ukulele.mp4&skips=https://videoskip.org/files/ukulele.skp

Result: the video loads and runs fine, but the skip file does not. Chrome reports this error on the console:

Access to fetch at 'https://videoskip.org/files/ukulele.skp' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

GET https://videoskip.org/files/ukulele.skp net::ERR_FAILED 200Uncaught (in promise) TypeError: Failed to fetch

at loadSkipsFromURL (videoskip.html?video=

https://videoskip.org/files/ukulele.mp4&skips=https://videoskip.org/files/ukulele.skp:450:5 ) at HTMLDocument. (videoskip.html?video= https://videoskip.org/files/ukulele.mp4&skips=https://videoskip.org/files/ukulele.skp:1535:7 )

But I have the server accepting all origins, so what gives?

The CORS problem disappears if I replace your fetch(url) instruction with this:

fetch(url, { mode: 'no-cors' // It can be no-cors, cors, same-origin })

But then when loadSkipsData(skips_data) executes, skips_data is an empty string "".

I think it would be necessary to be able to access non-local servers, because then you'll be able to load and edit movies from phones and such.

Let's see if you can fix it. Great work so far!

Paco

On Sun, Jun 19, 2022 at 12:56 PM Francisco Ruiz @.***> wrote:

Hi Eli,

I've been quite busy with my promotion case, but I think I'm close to being able to spend time on this. I'm not forgetting you.

On Sat, Jun 18, 2022 at 4:05 PM Eli Carter @.***> wrote:

I created a pull request (#10 https://github.com/fruiz500/VideoSkip/pull/10) with a cleaner implementation. Feedback welcome.

— Reply to this email directly, view it on GitHub https://github.com/fruiz500/VideoSkip/issues/9#issuecomment-1159562846, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATF25G6FMPV2T46FFCG4ITVPY22HANCNFSM5X4IWXYQ . You are receiving this because you commented.Message ID: @.***>

-- Francisco Ruiz Associate Professor MMAE department Illinois Institute of Technology

PL24wordLok==qualifications veterans speaker coating physically tapes worldsex folder book mostly distinguished shine enemy sticker focusing arena believe zinc baker thoroughly==PL24wordLok https:*//*www.youtube.com http://youtube.com/watch?v=BT_tFXpkUR0

get the PassLok privacy app at: https://passlok.com http://passlok.com

-- Francisco Ruiz Associate Professor MMAE department Illinois Institute of Technology

PL24wordLok==qualifications veterans speaker coating physically tapes worldsex folder book mostly distinguished shine enemy sticker focusing arena believe zinc baker thoroughly==PL24wordLok https:*//*www.youtube.com http://youtube.com/watch?v=BT_tFXpkUR0

get the PassLok privacy app at: https://passlok.com http://passlok.com

fruiz500 avatar Jun 25 '22 20:06 fruiz500

Hey Paco,

As I described in the original question, I was aiming for all three components (the videoskip.html player, the mp4/webm/etc video, and the skp skip file) being served from the same host. That was a conscious decision to avoid problems with CORS and same-origin security constraints. Digging into it a bit more, I don't think mode: 'no-cors' helps; this provides some explanation: https://stackoverflow.com/a/43268098

Regarding your comment that "I think it would be necessary to be able to access non-local servers, because then you'll be able to load and edit movies from phones and such.", I don't see why cross-server requests are needed for that use case. If you have the three components served from one server, you can point a phone at that server with the parameters in the url, the phone should load the skp file, etc., and once it is loaded, the page operates the same way it did before... namely, you can modify the skips in videoskip's textarea, and download the updated skp file. Copying that updated .skp file to the server would require another mechanism, but that has nothing to do with CORS.

Based on that, I don't think there is something to fix here.

Thoughts?

Eli

retracile avatar Jul 02 '22 18:07 retracile

I've pushed an update to provide an alert if the loading of the skips fails so it doesn't just fail silently.

retracile avatar Jul 02 '22 23:07 retracile