Skip to content
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

How do I get the currently-playing file? #32

Closed
dmerrick opened this issue Feb 25, 2020 · 7 comments
Closed

How do I get the currently-playing file? #32

dmerrick opened this issue Feb 25, 2020 · 7 comments

Comments

@dmerrick
Copy link

I have my ListPlayer all set up and running, but I can't for the life of me figure out how to get info on the currently-playing Media.

What I really want is the path to the current Media, but other metadata (such as the media's title) would also work.

Thanks!

@adrg
Copy link
Owner

adrg commented Feb 25, 2020

Hi @dmerrick. Thank you for your interest in the library. I need to implement a couple more bindings in order to be able to obtain metadata for Media objects. This feature was already high on my list of things I want to add to the library. However, I will make it top priority now that it has been specifically requested. I will add the new bindings sometime this week and let you know.

@dmerrick
Copy link
Author

Thank you, @adrg! I truly appreciate it, and let me know when/if you want someone to test

@adrg
Copy link
Owner

adrg commented Feb 27, 2020

Hi @dmerrick. I added the bindings for media metadata management. I also added an example for them: https://github.com/adrg/libvlc-go/blob/master/v3/examples/media_information.go.

I reorganized the repository in order to be able to develop each version of libVLC separately. The example I linked above uses the v3 version of the package (which implements bindings for libVLC v3.X or later). If you have libVLC 2.X installed, please use the v2 version of the package.

Let me know if you encounter any issues.

@dmerrick
Copy link
Author

Thank you, @adrg, that does exactly what I wanted it to do!

I did start getting the following warnings, but they didn't affect the functionality of my app:

# github.com/adrg/libvlc-go/v3
cgo-gcc-prolog: In function ‘_cgo_291a8504fc3b_Cfunc_libvlc_media_is_parsed’:
cgo-gcc-prolog:154:2: warning: ‘libvlc_media_is_parsed’ is deprecated [-Wdeprecated-declarations]
In file included from /usr/include/vlc/vlc.h:51,
                 from ../../go/pkg/mod/github.com/adrg/libvlc-go/v3@v3.0.1/media.go:4:
/usr/include/vlc/deprecated.h:249:4: note: declared here
  249 |    libvlc_media_is_parsed( libvlc_media_t *p_md );
      |    ^~~~~~~~~~~~~~~~~~~~~~
cgo-gcc-prolog: In function ‘_cgo_291a8504fc3b_Cfunc_libvlc_media_parse’:
cgo-gcc-prolog:207:2: warning: ‘libvlc_media_parse’ is deprecated [-Wdeprecated-declarations]
In file included from /usr/include/vlc/vlc.h:51,
                 from ../../go/pkg/mod/github.com/adrg/libvlc-go/v3@v3.0.1/media.go:4:
/usr/include/vlc/deprecated.h:209:1: note: declared here
  209 | libvlc_media_parse( libvlc_media_t *p_md );
      | ^~~~~~~~~~~~~~~~~~
cgo-gcc-prolog: In function ‘_cgo_291a8504fc3b_Cfunc_libvlc_media_parse_async’:
cgo-gcc-prolog:219:2: warning: ‘libvlc_media_parse_async’ is deprecated [-Wdeprecated-declarations]
In file included from /usr/include/vlc/vlc.h:51,
                 from ../../go/pkg/mod/github.com/adrg/libvlc-go/v3@v3.0.1/media.go:4:
/usr/include/vlc/deprecated.h:233:1: note: declared here
  233 | libvlc_media_parse_async( libvlc_media_t *p_md );
      | ^~~~~~~~~~~~~~~~~~~~~~~~

@adrg
Copy link
Owner

adrg commented Feb 29, 2020

Glad it worked for you. Those are just some deprecation notices for those bindings. libVLC v3 still has them though so I included them as well. I will suppress the warnings in a future release of the module and when libVLC removes those bindings, I will also remove them. That will probably happen in libVLC v4.

In the meantime, you can suppress the warnings when you build your project:

# suppress only deprecation notices.
CGO_CFLAGS="-Wno-deprecated-declarations" go build

# or suppress all warnings.
CGO_CFLAGS="-w" go build

@dmerrick
Copy link
Author

dmerrick commented Mar 1, 2020

Perfect. As far as I’m concerned, this issue is closed.

Thank you for being an exemplary maintainer

@adrg
Copy link
Owner

adrg commented Mar 1, 2020

Glad to help. Thank you for the kind words.

@adrg adrg closed this as completed Mar 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants