Would anyone be interested with this (small web app)
-
I tend to listen to a lot of youtube live streams and , I built this this morning.
So you paste in a vidoe url and it just inserts and iframe so you can watch.
I am probably going to improve it so it has an option for a pop up window. It is running in my local IIS and I find it useful. I dunno if other people would find it useful.
EDIT: Clarity.
-
@lucas1 How is this different than just opening the youtube embed link in a tab?
ETA: Ah, after your edit: you're trying to get around filters and/or country restrictions?
-
@lucas1 http://localhost/youtube_embed/ is returning ERR_CONNECTION_REFUSED to me
-
@Yamikuronue I didn't know you could do that. I wasted my morning ... HAHA
-
@lucas1 oh, yeah :D you just replace
/watch?v=
with/embed/
.
-
@Yamikuronue Yeah that basically what my script does. It like
8040 (without comments) odd lines of JS. So I just paste the URL straight into app. I suppose this would be more useful as a browser plugin.
-
@lucas1 I mean, if you run that on a server located in one country, it would be the one making the request ,and thus would get around country filters. Or if you're blocked from youtube at work but you can get to your own server, that'd also work. So it's not totally pointless, I know people that use proxies for that reason.
-
@Yamikuronue No it wouldn't work. Because the iFrame is being served by youtube.com.
If I proxied the video data stream (have to look at fiddler to see what youtube is doing) then that would work, but the bandwidth would cost me a bomb.
If I had realized I could use the embed code I wouldn't have bothered, it really shows you how much I avoid dealing with iFrames.
EDIT: Pity it is all pure JS without any nonsense. It is quite nice and clean.
-
@Yamikuronue said in Would anyone be interested with this (small web app):
I mean, if you run that on a server located in one country, it would be the one making the request ,and thus would get around country filters.
Nope; the browser is responsible for opening iframes, they'd have whatever the IP and locale of the browser is.
-
You know what the funny thing is, I was thinking "why hasn't anyone does this before!". HAHAHAHA
I am tears here laughing at how obvious my solution could have been.
-
Have you considered rewriting it in Rust?
-
@lucas1 Can you embed youtube on your page without it getting cropped on mobile? For some reason people wasn't able to do it on nodebb
-
@bb36e Yeah I could do it in post back using a Rust Web Framework that looks vaguely like flask, and build everything on post back and then write a rust plugin for IIS ... or I could use JS ;-)
@fbmac yes it could, It uses the youtube magic ratio (1.78 : 1) of the screen width. I haven't tried it on a portrait to landscape switch but it should work. I dunno how integrate with nodebb but you would need a click handler with the youtube iframe and then resize the iframe accordingly.
EDIT: Being thick again, yeh you could use parts of my scripts I build on click the resize.
So you would do something like (I have no idea if this would work, this is off the top of my head):
document.querySelectorAll('iframe[src*="youtube.com"]').onclick = function() { //snip call resize and reposition iframe logic. }
EDIT 2: you would need to deal with the full screen state of the iframe as well, but the Youtube iframe probably would do this for you.