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 to set a PlayList with a few audio/video files to load default? #1108

Open
lavanyadeepak opened this issue Jun 19, 2021 · 3 comments
Open

Comments

@lavanyadeepak
Copy link

Can some one point to a reference where I can set a playlist with a few audio/video files to load by default?

@captbaritone
Copy link
Owner

Check out the initialTracks property passed when constructing a new Webamp instance: https://github.com/captbaritone/webamp/blob/master/packages/webamp/docs/usage.md#construction

@neofright
Copy link

Check out the initialTracks property passed when constructing a new Webamp instance: https://github.com/captbaritone/webamp/blob/master/packages/webamp/docs/usage.md#construction

Can this be used to specify a file URI such as file:///bind_mount/playlist.m3u e.g.

  initialTracks: [{
    url: "file:///bind_mount/playlist.m3u"
  }],

I would love to create Docker container and put it behind a reverse http proxy that allows playing music bind mounted into to the container.

@neofright
Copy link

OK I answered my own question.

First off, WebAmp does not support playlists of any kind. You have to populate the json file list however you like.

Below are my unrelated explorations.

You can use the following file:/// scheme only if you disable CORS.

  initialTracks: [{
    url: "file:///path/to/a/track.mp3"
  }],

This can be done in Safari via:
Menu Bar > Develop > Developer Settings > "Disable Cross-Origin Restrictions".

I quickly spun up a Docker container with nginx and the following configs:

server
{
    access_log      /etc/nginx/conf.d/nginx-access.log;
    error_log       /etc/nginx/conf.d/nginx-error.log debug;

    # location / {  # new url path
    #     alias /music; # directory to list
    #     autoindex on;
    # }

    location / {
        root /music;
        index index.html index.htm;
        autoindex on;
    }
}
version: '2.3'
services:
  nginx:
    image: nginx
    container_name: nginx
    volumes:
      - /lol/path/nginx/nginx/conf.d:/etc/nginx/conf.d
      - /lol/path/Music:/music:ro ## Share the music library as read only.
    ports:
      - "80:80"

This also suffers from the same CORS issues, but can be used when disabled e.g. by specifying a URL to your web server such as http://example.com/album/mp3.mp3.

I was playing with https://github.com/captbaritone/webamp/blob/master/examples/multipleTracks/index.html for the prototyping.

I suspect the cross origin issues could be worked around by self hosting the instance of WebAmp but I've decided its not worth any more of my time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants