Hacker Newsnew | past | comments | ask | show | jobs | submit | LandOfMightDev's commentslogin

So basically, i built this platfrom/webapp that allows users to take a list of video URLs and convert into into a sort of live-stream. The only issue i had was that when I tried to embed it into static html pages as a video player, the top banner for "create channel" and "support" would show in the videoplayer, which just looked gross.

After searching online, most people just said it goes against CORS to modify the elements in the iFrame, so here was my solution:

```<div style="position: relative;overflow: hidden;"> <div style="margin-top:-80px;"> <iframe src="https://livechannels.pages.dev/(ChannelName)" width="1300px" height="820px" frameborder="0" allowfullscreen> </iframe> </div> </div>```

Basically, you just need to use two divs, one to set the overflow as hidden, and another to cut the portion of the page. In my case, I wanted to cut the nav bar, which was the first 80px at the top of the website. The end result was pretty much perfect.

Proof of concept websites:

https://animaxreboot.pages.dev/ https://cartoonnetworkhq.github.io/CartoonNetwork/


the live stream runs on its own, i dont host the files or have a server syncing the videos/serving. So basically, you can do this without any costs. Traditionally, you would need to use something like OBS and have a machine that both holds the video files, and "streams" them to clients.


forgot to mention, it also calculates the video position, to the minute by taking the time the channel was created, calculating the difference between the current time and the time the channel was created and taking the modulus of that and the total duration of all of the videos combined. You then use that to calculate which video should be playing and the difference between current time and the video duration is the position in the video that should sync.


"weight loss of 2kg", is that a side effect or the result of improved depression?


A few weeks ago I created the website livechannels.pages.dev which allowed users to create their own live-streaming internet channel from a list of video URLs. I remember watching ANIMAX as a child, then it disappeared, so i spent some time re-compiling all of the shows and creating a schedule/programming and here we are ! are created a live-streaming reboot style channel of Animax ! Enjoy, and feel free to make your own channels too!


Obviously I'm using a proxy to get on this website. But even without proxies it's still so slow.


If you have a foreign number roaming into China you shouldn't need proxies. Only Chinese numbers go through the great firewall. On the other hand, your speed might depend on your carrier's roaming arrangements.


doesn't work & also super illegal. Pretty much just pirated a shit ton of games and embedded them into a website. The controls just dont work and the website shifts whenever you try to move so it's just fucked


650 forks??


I'm convinced that a lot of people see Fork as a "retweet" button. Would be a lot better if it showed the number of forks that actually have changes instead.


You can look at the Repo and the actual game to see how it works in real time. https://landofmight.alwaysdata.net/

Before, there was no way to track the the state of the world after all player's logged off. Since i am using peer to peer (master - peer), there is no dedicated server, thus, no way to keep the game's state after the players leave. So i had this idea Friday evening. Basically, all i really needed was to record the NPCs stats (level, might, health), and their location. then every so many seconds, i needed to update it. When the first player joins, they will be the master client, and they will be the one keeping the server up to date & loading the world's state initially.

For example, player 1 joins, they are the master client now. Then, they play for a while, every 5 seconds the game does inventory and gives back all of the NPC's and their stats as a 2d text string array. This string array is encoded into a text file and sent to the github repo. 10 other players join (then due to other syncing I set up), they do not need to reload the world from the file, nor do they need to keep it updated (only one client needs to handle this).

Github allows 50,000 actions per hour, given that in order to update a file, you need to first pull the repo to see if a file exists & then get the file's sha. Essentially, you can have about 7.5 commits per second or about 133ms latency. Since only one client in the game is doing all of this, (updating the world's state, loading the world), there is no chance of exceeding the limit. Also, the latency for actually putting the file is normally around 400-800ms...

Yeah, also, the CDN will try to have give you the cashed version of the file, so make sure you force a new request each time you upload or the sha will mismatch. Also, when pulling the file, you may think that you can just use the raw url (atleast since it is a public repo), however, the CDN will just give you a shit copy of an older cached version.

So apart from all this, the hardest part is integrating it with webgl and unity. Unity is a piece of shit when it comes to networking, it does not support Asyn, so you need to use enumerators for everything.. Also, you cannot use any non-native networking modules. So everything must be done using UnityEngine.Networking. Lastly, headers are a joke in webgl, do not even try to use any headers other than Authorization and Content-Type or CORS will fuck you.

Now, the fact that you can do this is pretty cool. There are a ton of services that offer the same functions, yet charge alot. Even more, if you were developing a game that isn't super high-paced / a strategy game etc. Or you dont care about having potentially terrible latency (50,000 requests (2 requests per put), 133ms minimum delay, more users, less requests etc.etc.), so if your users can go with a 5000ms latency, this could be used for other multiplayer scenarios.


This is my game, I've been working on it for the last four years. All npcs have a rudimentary AI that allows them to progress like players, leveling up and increasing their stats. They will also occasionally form teams/groups (normally aggressive to all other npcs), based on might/score. Try it out.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: