-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding a video player? #51
Comments
To compare a similar solution, Glimmer DSL for SWT already has a custom widget that is a video player: So, you just say video(file: video_file) It can accept many options like automatic looping and event listeners: video(file: video_file, looped: true, background: :black) {
on_playing {
display_video_status(@video, 'Playing')
}
on_paused {
display_video_status(@video, 'Paused')
}
} So, ideally, we would have something similar in Glimmer DSL for LibUI. But, a
All approaches require an effort to be completed in C, but could eventually get wrapped by Ruby code and exposed/used in Glimmer DSL for LibUI syntax. Please keep in mind that Delphi was sponsored by big corporations that were loaded with software engineering time and salaries. LibUI and Glimmer are fully free and open-source projects and community efforts, so although everything is technically possible with them, the effort might be too big to complete in a short amount of time. That's unless some software engineers play the role of champions by creating their own open-source project that is fully focused on creating a In any case, I will keep this issue open until a Thank you for reporting. |
By the way, if you only need to open a video player separately from the GUI of a Glimmer DSL for LibUI application (as opposed to embedding a video inside the GUI), then this is certainly doable today. I just remembered that rubio-radio, which is built with Glimmer DSL for LibUI, actually leverages an existing video player called VLC. It simply calls out to it on the command line like in this Ruby code (but it only needs the audio support of the video player, so it intentionally does not display the video player, but I've gotten it to display the video player before as that depends on what options you pass to the backend = 'vlc -I rc'
@io = IO.popen("#{backend} \"#{url}\"", 'r+') Full code is here (look at the rubio-radio is a free and open-source project, so you are welcome to install it and play around with it. I actually use it everyday as my main Internet radio app. Please let me know if this solution addresses your need (or if it addresses your need in the short term at least). |
It’s doable using mpv but i want to be able to integrate controls on the
view to provide a gaming experience. Delphi works because it use ActiveX
which allow me to embed MPlayer control developed by microsoft. I think
glimmer better provide a wrapper to different video players on different
platform. On Windows there is MediaPlayer, on Mac there is Starling?
…On Tue, 6 Jun 2023 at 09:31 Andy Maleh ***@***.***> wrote:
By the way, if you only need to open a video player separately from the
GUI of a Glimmer DSL for LibUI application (as opposed to embedding a video
inside the GUI), then this is certainly doable today. I just remembered
that rubio-radio <https://github.com/kojix2/rubio-radio>, which is built
with Glimmer DSL for LibUI, actually leverages an existing video player
called VLC <https://github.com/videolan/vlc>.
It simply calls out to it on the command line like in this Ruby code:
backend = 'vlc -I ***@***.*** = IO.popen("#{backend} \"#{url}\"", 'r+')
Full code is here (look at the initialize and play methods):
https://github.com/kojix2/rubio-radio/blob/main/lib/rubio/model/player.rb
rubio-radio <https://github.com/kojix2/rubio-radio> is a free and
open-source project, so you are welcome to install it and play around with
it.
Please let me know if this solution addresses your need, or if it
addresses your need in the short term at least.
—
Reply to this email directly, view it on GitHub
<#51 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABM5ZJCRUG5LEKYSEL5FGTXJ2JA5ANCNFSM6AAAAAAYZXHEYU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Just wanted to add: I've written an app with python and python-vlc that includes VLC. I've tried to do it in ruby with gtk and FFI, but the problem was that you get a window handle and GTK didn't really let me add that without tricks. Protip: ChatGPT is quite good at writing FFI Code for libraries. https://gist.github.com/Largo/bf95d8d0089f7c411fb7bdc48c8e6a30 Writing a video player ontop of vlc in ruby and distributing it with ocran would be a very interesting project. GTK3 is starting a bit to slow on windows, but it would be awesome with libui |
I guess making this available to mac and windows until a genius come along
and add it for linux. The app simply render a blank view writing video not
supported on linux
…On Mon, 12 Jun 2023 at 10:10 Largo ***@***.***> wrote:
Just wanted to add: I've written an app with python and python-vlc that
includes VLC. I've tried to do it in ruby with gtk and FFI, but the problem
was that you get a window handle and GTK didn't really let me add that
without tricks.
I haven't tried it with libui yet, but what we would need for that is
basically being able to get a "window" handle of a control inside the
window. I believe GTK didn't let me do that, but I found a workaround to do
it via the windows api. That would not be crossplatform so I gave up.
Protip: ChatGPT is quite good at writing FFI Code for libraries.
https://gist.github.com/Largo/bf95d8d0089f7c411fb7bdc48c8e6a30
—
Reply to this email directly, view it on GitHub
<#51 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABM5ZOTPQMJLDOTRVVZRE3XK2CDZANCNFSM6AAAAAAYZXHEYU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@AndyObtiva FYI I tried glimmer-cw-video but looks like it's not working with latest version of jruby (and whatever dependencies of glimmer-dsl-swt and glimmer-dsl-xml that bundler resolved to). I submitted an issue on the repo. |
I was programming Delphi in 2000 and it's a cake adding a video player to the app. Wonder how would one do it with something like libui. There are several video player around but I guess there need a mechanism to wrap them to something before they can be used.
The text was updated successfully, but these errors were encountered: