Coder Social home page Coder Social logo

Comments (6)

netmms avatar netmms commented on July 23, 2024 1

Thank you very much Rodrigo.

I can confirm that I was able with the new version to see and play the media correctly through the webui.

However, I cannot do that through the play_media service, which is actually my main intended use.

I set up the service as follows in HA configuration.yaml:

media_player:
  - platform: vlc
    name: spkr

However, I get the following error when the server restarts:

Error while setting up platform vlc
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 150, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/vlc/media_player.py", line 47, in setup_platform
    [VlcDevice(config.get(CONF_NAME, DEFAULT_NAME), config.get(CONF_ARGUMENTS))]
  File "/usr/src/homeassistant/homeassistant/components/vlc/media_player.py", line 56, in __init__
    self._instance = vlc.Instance(arguments)
  File "/usr/local/lib/python3.7/site-packages/vlc.py", line 1551, in __new__
    return libvlc_new(len(args), args)
  File "/usr/local/lib/python3.7/site-packages/vlc.py", line 3903, in libvlc_new
    ctypes.c_void_p, ctypes.c_int, ListPOINTER(ctypes.c_char_p))
  File "/usr/local/lib/python3.7/site-packages/vlc.py", line 246, in _Cfunction
    raise NameError('no function %r' % (name,))
NameError: no function 'libvlc_new'

For some reason it is looking for libvlc_new, which it cannot find.

BTW, I am using the latest Hass.io 0.103.0

from hassio-local-vlc.

rodripf avatar rodripf commented on July 23, 2024

You are right, I never noticed since it is not the way I use it. Thank you for your report, I'll try to fix it!

In the meantime, if it's useful for you, I manage to play my files in one of the following ways:

-Using the play_media service to play for example an mp3 in the /share directory
-To play more than one file, I do create an m3u file (a simple text file with one song file per line) and then play the m3u file using the play_media service

from hassio-local-vlc.

rodripf avatar rodripf commented on July 23, 2024

I generated a new version with the fix. If you update the add-on in your hassio control panel you should be able to find the files on the web interface using the "Open Media" button now (the one on the left the of stop button).

Cheers

from hassio-local-vlc.

rodripf avatar rodripf commented on July 23, 2024

Hi @netmms! This add-on was made to communicate to home assistant over telnet, so you should be using the VLC Telnet plattform, instead of the bare VLC one.

Please refer to the correspondent documentation here:
https://www.home-assistant.io/integrations/vlc_telnet/

The VLC component you tried to use does not support Hass.io, that's why I developed this addon in the first place and the VLC Telnet component.

Please let me know if everything went OK!
Cheers

from hassio-local-vlc.

netmms avatar netmms commented on July 23, 2024

I can confirm that works! Thank you very much. This is a much better solution than Mopidy, which has problems with setting the volume control and also with the playback quality.

The only regrets are:

It is not advertised as widely as it should, IMHO.

And I took a non-linear path to finally getting it to work. If you like, perhaps you can add the following to the readme file so beginners like me would be able to get it to work more easily:

You can test the service directly by launching the webui, clicking on the “eject” button, and selecting the file you want to play. If you do not see the file there, something is wrong, or you have not placed the file in the right folder.

I order to use the service within Hassio / Home Assistant, you need to utilize VLC-Telnet. You can start by visiting these two sites:
https://www.home-assistant.io/integrations/vlc_telnet/
https://community.home-assistant.io/t/remote-vlc-remote-controller-via-telnet/129742

Or, if you are lazy :), define it in configuration.yaml as follows:

media_player:
  - platform: vlc_telnet
    name: vlc
    host: HA_IP
    password: PASSWD defined in the VLC config page

Then play any file as follows:

    service: media_player.play_media
    data_template:
      entity_id: media_player.vlc
      media_content_id: /share/file.mp3
      media_content_type: music

from hassio-local-vlc.

shirou93 avatar shirou93 commented on July 23, 2024

@rodripf I have this same issue on 0.112.4 HA. Can you check this?

from hassio-local-vlc.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.