4 ms·
Why did you go with PHP over another language? Do you have comparable experience with other languages to have had legitimate alternative options? Genuine questi
by silicon2401 5y ago
Why did you go with PHP over another language? Do you have comparable experience with other languages to have had legitimate alternative options? Genuine question.
I'm deeply interested in your project as I have a similar goal. I would also like to create my own custom entertainment setup, throwing in commercials/trailers with feature presentations. Do you have a website or place I can reach out to you with questions?
Or for Hacker News readers, if I want to create a similar custom media playlist kind of thing, is it possible to do that with VLC or would I have to write a custom solution?
- thrusong 5y agoI've dabbled a bit in C/C++, and even a little Python, but not enough to build something like this. Maybe one day I'd like to re-write it with everything I've learnt so I can compile it and monetize it. I've also thought about open sourcing it, but the code is a little rough (messy) as-is and I struggle with what to do. I know JavaScript and PHP, and PHP just seemed to do everything I needed. I built a website a long time ago for collaborative music composition. It interacted with command line software and used XMPP to communicate with the server. That sorta lead to using PHP to control everything in the theatre, plus a lot of the components I bought can be controlled through HTTP commands. Overall, this was a side-project and I've slowly perfected the timing and the features over the past six years to where I have it pretty feature complete and reliable now. Everything is timed perfectly, it can handle intermissions, overtures, and exit music. If there's some sort of break down, it shows film melting, shuts off the projector, and brings the lights up... Stuff like that. As for VLC: This all runs on a Raspberry Pi 4. I originally used VLC but started having trouble with it when I moved from the Odroid XU4 to the Pi, so now it runs on mpv. Moved to the Pi because I wanted to run Netflix in the theatre easily as well. If the Odroid ran Netflix (and some other small things), I'd prefer it.
- denton-scratch 5y agoFor my part, I learned PHP because a lot of small web-shops were using it, and I wanted a job in a small web-shop. Previously I had coded professionally in COBOL, C, VB6, and Java, and I knew Forth. I made money writing PHP for a decade-and-a-half. Straight PHP is not particularly lucrative work; but Drupal module development can pay quite well. For the "custom media playlist": VLC is just a player. But there's a player built-into your browser; my home-brew playlist originally used VLC, but I switched to using the <video> tag once it became reliable (and would play ogg/vorbis properly). You still need a backend; and you'll probably need quite a bit of Javascript.
- silicon2401 5y ago> But there's a player built-into your browser; my home-brew playlist originally used VLC, but I switched to using the <video> tag once it became reliable (and would play ogg/vorbis properly). Interesting. To use a very high level example, would something like the following work? Have a backend generate a webpage with a video from local storage playing via <video> tags, then refresh with javascript and have a different video playing?
- denton-scratch 5y agoAbsolutely - that's exactly what I do. I have a playlist manager, navigation and so on. You can use a mouse, but it's designed for keyboard operation; there's a lot of hotkeys. Hang on - you said "from local storage". The video is played from server-side storage. If it was on local storage on the client, you could only play it on that client. So I take it you meant "local to the server", in contrast to online video resources.
- silicon2401 5y ago> Hang on - you said "from local storage". The video is played from server-side storage. If it was on local storage on the client, you could only play it on that client. So I take it you meant "local to the server", in contrast to online video resources. Bingo. In switching over to pet project thought mode I started thinking "local to myself" rather than the usual client-server wording. Thanks for the advice! That sounds genius. I can much more easily imagine implementing this with my existing skills compared to figuring out how to script VLC or some other media player. Now I'm guessing this approach serves the server media file to the client browser, and the client browser then plays it locally. Would it be possible to create a kind of TV-channel/radio-station type of approach where the server is constantly playing a video, and any client on the network can hop onto the stream like a TV channel?
- denton-scratch 5y agoThe <video> tag also has a javascript model you have to learn, like with VLC. It gets video in junks, on request from the browser; if nobody's requesting chunks, no chunks will be played. You can't play if there's nobody listening. It doesn't serve files. If you start a new item, it begins to play immediately - it doesn't seem to need to buffer. I imagine your media channel thing can be done, but I haven't tried it or thought about it. Not my use-case! It's not "genius", BTW - I'm no media expert, not even a very good programmer. I'm just a tinkerer with an itch to scratch. And there's no way I'm sharing my code - it's a pile of crap, permanent work-in-progress. I like the <video> tag very much, because it's cross-browser, and (IMO) is easier to script than previous players.