X-platform media player library of choice?

A place to discuss and plan OpenSource xTalk (not exclusively LCC based)
and Community Builds of LCC ...Ask NOT what xTalk can do for you...
Get involved you DO have something to contribute, no matter your skillset!

Forum rules
A place to discuss and plan OpenSource xTalk (not exclusively LCC based) and Community Builds of LCC
Ask NOT what xTalk can do for you... get involved you DO have something to contribute, no matter your skillset!
User avatar
OpenXTalkPaul
Posts: 1485
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

X-platform media player library of choice?

Post by OpenXTalkPaul »

So since we're FOSS over here we can use a FOSS cross-platform video/media player engine.
There are a few FOSS engines that are available cross-platform in shared library / framework form including the wildly successful VideoLAN Client ( libVLC C++,VLCKit Obj C, etc.) engine, which VLC has been my go to media player on every platform for decades now. On the other hand could just stick with APIs that are available in the OS on macOS and Win (is there too many options on Linux? Does anyone actually used the 'videoClipPlayer' prop to change default player?). I mean myself and I'm sure many others depended on QuickTime for some things for a long, long time and then it was faded away...but we can have a playback engine that gets included and optionally added into desktop stand-alones same as with any stack files, extensions, widget or library.
Was just looking at this so it had me thinking about it.
https://www.videolan.org/vlc/libvlc.html
User avatar
richmond62
Posts: 2617
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: X-platform media player library of choice?

Post by richmond62 »

The VLC rocks, and I also, use it on every platform I use.
https://richmondmathewson.owlstown.net/
User avatar
OpenXTalkPaul
Posts: 1485
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: X-platform media player library of choice?

Post by OpenXTalkPaul »

It would also be a bit of free advertising if we could have OXT xTalk Script Wrapper on that list of language bindings. ;) right in there with Python.
User avatar
overclockedmind
Posts: 268
Joined: Sat Apr 30, 2022 9:05 pm
Location: Midwest US
Contact:

Re: X-platform media player library of choice?

Post by overclockedmind »

Every machine with any of the three OSes in discussion has had an install of VLC, through major revision numbers. My AppleTV has it (dunno who compiled it, but many thanks to them.) I'm positive that if uses of media apps were counted (which apps the AppleTV had run, and how many times) that it would place first.

Most of the people that use VLC don't even know it's open source, they just know it plays everything. ;)
MBA (Early 2015, 8GB/512G SSD, Monterey 12.7.2)
System76 serv12 (64GB RAM, 2TB SSD, 2TB HD, Win 10 Pro x64)
Power Mac 3,1 Project - Needs TLC will get it soon
User avatar
richmond62
Posts: 2617
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: X-platform media player library of choice?

Post by richmond62 »

I have never seen VLC automatically installed on a system. I have always installed VLC myself after having installed an operating system.
https://richmondmathewson.owlstown.net/
User avatar
overclockedmind
Posts: 268
Joined: Sat Apr 30, 2022 9:05 pm
Location: Midwest US
Contact:

Re: X-platform media player library of choice?

Post by overclockedmind »

richmond62 wrote: Mon Jul 18, 2022 5:31 am I have never seen VLC automatically installed on a system. I have always installed VLC myself after having installed an operating system.
It's definitely a must-have.
MBA (Early 2015, 8GB/512G SSD, Monterey 12.7.2)
System76 serv12 (64GB RAM, 2TB SSD, 2TB HD, Win 10 Pro x64)
Power Mac 3,1 Project - Needs TLC will get it soon
User avatar
overclockedmind
Posts: 268
Joined: Sat Apr 30, 2022 9:05 pm
Location: Midwest US
Contact:

Re: X-platform media player library of choice?

Post by overclockedmind »

OpenXTalkPaul wrote: Sun Jul 17, 2022 4:41 pm It would also be a bit of free advertising if we could have OXT xTalk Script Wrapper on that list of language bindings. ;) right in there with Python.
We need to do this. We need momentum.
MBA (Early 2015, 8GB/512G SSD, Monterey 12.7.2)
System76 serv12 (64GB RAM, 2TB SSD, 2TB HD, Win 10 Pro x64)
Power Mac 3,1 Project - Needs TLC will get it soon
User avatar
OpenXTalkPaul
Posts: 1485
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: X-platform media player library of choice?

Post by OpenXTalkPaul »

richmond62 wrote: Mon Jul 18, 2022 5:31 am I have never seen VLC automatically installed on a system. I have always installed VLC myself after having installed an operating system.
We could include Shared Library version libVLC (plus dependencies?) C++, and VLCKit (.Framework) Objective C on macOS/iOS, wrapped up in Extension Builder binding strings. Including those binaries might be adding a lot to the size of the IDE bundle though? I'd really prefer to use preinstalled System APIs, or failing that at least libraries that are compact in size without too many dependencies if at all possible. I have seen VLC preinstalled in a few distros but is there really any multimedia things that are commonly in most Linux distros?

I was also looking for possibly easy ways to enable (re-enable?) x-platform multimedia 'record' command.
OXT FluidSynth wrapper already includes libSndFile as a dependency. Could maybe expand on that lib adding in libSOX.
Is there an easy way to record sound via commonly available Linux lib or CLI app ( for shell() ) ?

I'd also like to enable revSpeak (or rather revert to simply 'Speak', as the command was named in HyperCard) to be available on Linux. I started to wrap eSpeak_ng (slightly Speak-N-Spell -ish sounding), but again there's more than one library out there for Text To Speech Linux.
I suppose a lot of things like that could be handled just using shell() on Linux, including checking for availability of a lib/CLI and then using one of multiple options.

I'm surprised that it seems not too many people seemed to have ever done much of anything with MC/RR/LC's MCISendString() on Windows. I wasn't a windows guy (if I could avoid it) back when (ever), so I wasn't familiar with MCI, but you can apparently do a lot with those strings on Windows (although deprecated for a long time now it seems, it's quite an ancient Win32 API) or IBM OS2! You can use them to do MIDI playback, recording audio, control optical drives, etc.
User avatar
overclockedmind
Posts: 268
Joined: Sat Apr 30, 2022 9:05 pm
Location: Midwest US
Contact:

Re: X-platform media player library of choice?

Post by overclockedmind »

OpenXTalkPaul wrote: Tue Jul 19, 2022 1:57 am
richmond62 wrote: Mon Jul 18, 2022 5:31 am I have never seen VLC automatically installed on a system. I have always installed VLC myself after having installed an operating system.
We could include Shared Library version libVLC (plus dependencies?) C++, and VLCKit (.Framework) Objective C on macOS/iOS, wrapped up in Extension Builder binding strings. Including those binaries might be adding a lot to the size of the IDE bundle though? I'd really prefer to use preinstalled System APIs, or failing that at least libraries that are compact in size without too many dependencies if at all possible. I have seen VLC preinstalled in a few distros but is there really any multimedia things that are commonly in most Linux distros?

I was also looking for possibly easy ways to enable (re-enable?) x-platform multimedia 'record' command.
OXT FluidSynth wrapper already includes libSndFile as a dependency. Could maybe expand on that lib adding in libSOX.
Is there an easy way to record sound via commonly available Linux lib or CLI app ( for shell() ) ?

I'd also like to enable revSpeak (or rather revert to simply 'Speak', as the command was named in HyperCard) to be available on Linux. I started to wrap eSpeak_ng (slightly Speak-N-Spell -ish sounding), but again there's more than one library out there for Text To Speech Linux.
I suppose a lot of things like that could be handled just using shell() on Linux, including checking for availability of a lib/CLI and then using one of multiple options.

I'm surprised that it seems not too many people seemed to have ever done much of anything with MC/RR/LC's MCISendString() on Windows. I wasn't a windows guy (if I could avoid it) back when (ever), so I wasn't familiar with MCI, but you can apparently do a lot with those strings on Windows (although deprecated for a long time now it seems, it's quite an ancient Win32 API) or IBM OS2! You can use them to do MIDI playback, recording audio, control optical drives, etc.
In my opinion, there are other players, that play a subset of the things VLC does. Quite a lot of mplayer front-ends; having fallen for vlc though, I don't pay much attention to alternatives. With Linux, there's always alternatives.
MBA (Early 2015, 8GB/512G SSD, Monterey 12.7.2)
System76 serv12 (64GB RAM, 2TB SSD, 2TB HD, Win 10 Pro x64)
Power Mac 3,1 Project - Needs TLC will get it soon
User avatar
overclockedmind
Posts: 268
Joined: Sat Apr 30, 2022 9:05 pm
Location: Midwest US
Contact:

Re: X-platform media player library of choice?

Post by overclockedmind »

This might get you started on your understanding:

https://linuxhint.com/install_multimedia_codecs_ubuntu/

Edit: There were a bunch of non-sensical lines after the URL. Adding text fixed it.
MBA (Early 2015, 8GB/512G SSD, Monterey 12.7.2)
System76 serv12 (64GB RAM, 2TB SSD, 2TB HD, Win 10 Pro x64)
Power Mac 3,1 Project - Needs TLC will get it soon
User avatar
OpenXTalkPaul
Posts: 1485
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: X-platform media player library of choice?

Post by OpenXTalkPaul »

from that link:
By default, multimedia codecs are not installed on Ubuntu 20.04 LTS.

As you can see, I am not able to play the video file Big Buck Bunny-720.mp4 with the default Ubuntu 20.04 LTS
That's pretty much what I thought was the case. Which still seems odd given how ubiquitous .mp4 has become.

According to the fan-wiki the Linux engines require XAnim for 'play' command to work, which is almost a quarter of a century old! I'm not sure if that is still the case? Maybe we could compile a thorough list of every dependency, either embedded or external that the engines require for full functionality. Then we can better think on what could be replaced/updated to something more modern and common.
https://livecode.fandom.com/wiki/Installing_xanim

I was also reading about the Emscripten runtime (not just the LCs engine running onto of it) and found it very interesting that they included some of SDL (Simple Direct-Media Layer) compatibility in API. Now it would be a lot of work to wrap all of SDL, but maybe just a subset of SDL could be a more reasonable goal to start out.

Has anybody experimented with wrapping the Enscripten / webasm engine inside one of the many JS standalone app wrappers such as Electron?

Also not really related, but anyone else played around with 'do "<JavaScriptCodeGoesHere>" as javascript' on macOS? I'm not talking about do JS in a browser widget, I'm talking about the macOS system level JSX (JavaScriptForAutomation), which is available as open-scripting-architechure (OSA) in macOS 10.10.+ and works in exactly the same way as 'do tMyAppleScript as appleScript'? I just tried it with super-simple JS functions, setting result = myfunction() to retrieve with xTalk 'the result' and it works. Like AppleScriptObjC, there is JavaScriptObjC so one could theoretically built an entire cocoa app with native GUI with it. And like just AS, JSX is extensible.

I had some time to kill and was using for researching. These would be down-the-road goals.
I need to concentrate on getting OXT packaged and released right now.
User avatar
OpenXTalkPaul
Posts: 1485
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: X-platform media player library of choice?

Post by OpenXTalkPaul »

Part of why I was looking at Emscripten is because the HTML5 deployment files have an LC logo from their website linked into it, so that needs to be changed for the de-branding.

But it has me thinking about JS/HTML5 a lot. Extension Builder includes an Emscripten module for wrapping JS for use with HTML5 engine. There aren't many publicly available examples of using this module that I could find though. The HTML5 'native' button widget and a few snippets from the docs is pretty much all there is.

I haven't really played around with the Emscripten engine, mostly because I never bothered to set up a WebServer and most browsers will not allow local file/same origin loading, which by default is the only way to test those builds.

However, these JS app engines basically run JS in their own embedded web servers/js engines (ie. Node.js in Electron apps) but do not have the same sand-boxed restrictions on execution that most modern web-browsers have. They can access the local file system. If we wrapped the Emscripten engine in an App wrapper (such as Electron) we would have 'near-native' speed regardless of underlying OS/Architechure, and would gain access to all that NODE.js and the like have to offer, such as native system APIs, as well as a massive amount of community created libraries. I'm aware of the limitations of the Emscripten engine, such as non-working 'wait' command (actually it's really a no-blocking policy for any JS). I've always tried to avoid blocking anyway, but there's probably some alternative options ( possibly included in some of these JS app wrappers) with callbacks and timers. Perhaps we can mix in some ///_HyperScript js that has 'promises', which are like non-blocking 'wait' that finish executing once they get a callback when the (remote) promised data is delivered.
User avatar
overclockedmind
Posts: 268
Joined: Sat Apr 30, 2022 9:05 pm
Location: Midwest US
Contact:

Re: X-platform media player library of choice?

Post by overclockedmind »

OpenXTalkPaul wrote: Wed Jul 20, 2022 12:58 pm from that link:
By default, multimedia codecs are not installed on Ubuntu 20.04 LTS.

As you can see, I am not able to play the video file Big Buck Bunny-720.mp4 with the default Ubuntu 20.04 LTS
That's pretty much what I thought was the case. Which still seems odd given how ubiquitous .mp4 has become.

According to the fan-wiki the Linux engines require XAnim for 'play' command to work, which is almost a quarter of a century old! I'm not sure if that is still the case? Maybe we could compile a thorough list of every dependency, either embedded or external that the engines require for full functionality. Then we can better think on what could be replaced/updated to something more modern and common.
https://livecode.fandom.com/wiki/Installing_xanim

I was also reading about the Emscripten runtime (not just the LCs engine running onto of it) and found it very interesting that they included some of SDL (Simple Direct-Media Layer) compatibility in API. Now it would be a lot of work to wrap all of SDL, but maybe just a subset of SDL could be a more reasonable goal to start out.

Has anybody experimented with wrapping the Enscripten / webasm engine inside one of the many JS standalone app wrappers such as Electron?

Also not really related, but anyone else played around with 'do "<JavaScriptCodeGoesHere>" as javascript' on macOS? I'm not talking about do JS in a browser widget, I'm talking about the macOS system level JSX (JavaScriptForAutomation), which is available as open-scripting-architechure (OSA) in macOS 10.10.+ and works in exactly the same way as 'do tMyAppleScript as appleScript'? I just tried it with super-simple JS functions, setting result = myfunction() to retrieve with xTalk 'the result' and it works. Like AppleScriptObjC, there is JavaScriptObjC so one could theoretically built an entire cocoa app with native GUI with it. And like just AS, JSX is extensible.

I had some time to kill and was using for researching. These would be down-the-road goals.
I need to concentrate on getting OXT packaged and released right now.
It's a little different here in Linux Land. If you're setting up a server for a SQL database, do you want a GUI? Or the ability to play MP3s? You choose what you want and pass on the rest, whether it be for speed and security, or the "Free Software Philosophy," which is something you'll have to read up on. Some people only want software they can get the source for and eyeball. Some people want strictly free software. Some people set up a whole machine to do one thing with software that isn't free (which admittedly, there's not a lot of.)

SOME people consider code that does something (play a video file,) but that was re-written from the ground up (which it sure has to be, or now we're running over copyright entirely) not to their liking, and don't want it anywhere near their hardware, or more likely their company's hardware which makes total sense. That's why it's options, from the bottom up. A distro is a collection of software that fits with what people like and after maybe a program gone or a few added is just about right.

I'm no lawyer, but there's quite a bit to grab onto there. Some get really hot under the collar about different definitions of the word "free." Which if you think of it, there sure are.
MBA (Early 2015, 8GB/512G SSD, Monterey 12.7.2)
System76 serv12 (64GB RAM, 2TB SSD, 2TB HD, Win 10 Pro x64)
Power Mac 3,1 Project - Needs TLC will get it soon
User avatar
overclockedmind
Posts: 268
Joined: Sat Apr 30, 2022 9:05 pm
Location: Midwest US
Contact:

Re: X-platform media player library of choice?

Post by overclockedmind »

In line with what you're talking about, in high school, I figured out that apps could communicate in AppleTalk to pass names and messages, with HyperCard as the front-end, OVER THE NETWORK. The names were something like 'Machine:Application' which I pondered for a bit and then got in trouble for: I wrote a LAN Messenger for our Macs at high school, like a beta-beta ICQ where we just made up our own names. Which bit the dust via executive order...

After that, I had to promise to keep my shenanigans to one machine, and one only. To which, I agreed.
MBA (Early 2015, 8GB/512G SSD, Monterey 12.7.2)
System76 serv12 (64GB RAM, 2TB SSD, 2TB HD, Win 10 Pro x64)
Power Mac 3,1 Project - Needs TLC will get it soon
User avatar
OpenXTalkPaul
Posts: 1485
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: X-platform media player library of choice?

Post by OpenXTalkPaul »

OpenXTalkPaul wrote: Wed Jul 20, 2022 1:56 pm
I haven't really played around with the Emscripten engine, mostly because I never bothered to set up a WebServer and most browsers will not allow local file/same origin loading, which by default is the only way to test those builds.
Scratch that!

I just realized that on macOS, if you enable the developer menu in Safari then you can check the 'Disable Cross-Origin Restrictions" from that menu and then a Standalone Emscripten WebApp will run from a folder on the local filesystem, sans-webserver! If you do that then make sure that you uncheck that menu item to turn back on those restrictions when you're done developing, for security sake.

There's two LC icons that currently get overlayed with the (OXT) Emscripten Engine.
User avatar
OpenXTalkPaul
Posts: 1485
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: X-platform media player library of choice?

Post by OpenXTalkPaul »

overclockedmind wrote: Wed Jul 20, 2022 3:10 pm In line with what you're talking about, in high school, I figured out that apps could communicate in AppleTalk to pass names and messages, with HyperCard as the front-end, OVER THE NETWORK. The names were something like 'Machine:Application' which I pondered for a bit and then got in trouble for: I wrote a LAN Messenger for our Macs at high school, like a beta-beta ICQ where we just made up our own names. Which bit the dust via executive order...

After that, I had to promise to keep my shenanigans to one machine, and one only. To which, I agreed.
Yes with AppleEvents! You can send any sort of data to apps across a network (but AppleTalk dead since Snow 10.6).
AppleEvents are still very much usable. I mean it's what AppleScript is built on right?
In fact that's how I handled the HyperCard stack crashing IDE problem, on AppleEvent captures aevt,odoc data (file list) and then checks file (just remembered I need to add a loop there) for the header bytes that contain "STAK' (magic number) type code, and then if present, renames the filename to filename.stak and then launches the file with the HyperCardPreview.app (which requires the .stak filename extension) and doesn't pass on the AppleEvent to the engine. When I quit HyperCardPreview.app another AppleEvent "aevt,rapp" gets sent to the Engine to let it know that the process that the engine launched finished or quit.
User avatar
overclockedmind
Posts: 268
Joined: Sat Apr 30, 2022 9:05 pm
Location: Midwest US
Contact:

Re: X-platform media player library of choice?

Post by overclockedmind »

OpenXTalkPaul wrote: Wed Jul 20, 2022 6:07 pm
overclockedmind wrote: Wed Jul 20, 2022 3:10 pm In line with what you're talking about, in high school, I figured out that apps could communicate in AppleTalk to pass names and messages, with HyperCard as the front-end, OVER THE NETWORK. The names were something like 'Machine:Application' which I pondered for a bit and then got in trouble for: I wrote a LAN Messenger for our Macs at high school, like a beta-beta ICQ where we just made up our own names. Which bit the dust via executive order...

After that, I had to promise to keep my shenanigans to one machine, and one only. To which, I agreed.
Yes with AppleEvents! You can send any sort of data to apps across a network (but AppleTalk dead since Snow 10.6).
AppleEvents are still very much usable. I mean it's what AppleScript is built on right?
In fact that's how I handled the HyperCard stack crashing IDE problem, on AppleEvent captures aevt,odoc data (file list) and then checks file (just remembered I need to add a loop there) for the header bytes that contain "STAK' (magic number) type code, and then if present, renames the filename to filename.stak and then launches the file with the HyperCardPreview.app (which requires the .stak filename extension) and doesn't pass on the AppleEvent to the engine. When I quit HyperCardPreview.app another AppleEvent "aevt,rapp" gets sent to the Engine to let it know that the process that the engine launched finished or quit.
Yep. This was on 99% 68K machines, though. I treated it with the greatest of respect, they weren't going to find out if I did...
It's what Preview writes automatically if you "recorded" something with it.
MBA (Early 2015, 8GB/512G SSD, Monterey 12.7.2)
System76 serv12 (64GB RAM, 2TB SSD, 2TB HD, Win 10 Pro x64)
Power Mac 3,1 Project - Needs TLC will get it soon
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests