Giter Site home page Giter Site logo

lucos_media_seinn's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar lucas42 avatar

Watchers

 avatar  avatar

lucos_media_seinn's Issues

Start chrome receiver automatically

At the moment, the chrome receiver needs starting manually by pressing the chromecast button in the UI. It'd be nice to automatically start the receiver app somehow.
(Perhaps running something on a raspberry pi on the same network as the cast devices - would that give it sufficient access to start the receiver app?)

Import lucos modules

Currently this app includes source code for the following modules, which are now available on npm:

  • lucos_navbar
  • lucos_time_component
  • lucos_pubsub

Switch to using the npm ones so it's easier to keep reusable logic up-to-date across apps, and remove the corresponding source code from here.

Depends on #42 as the npm versions of the modules all expose ES Module interfaces.

Scroll viewer to top when new lyrics are added.

At the moment, the lyrics viewer keeps its scroll position if a new song comes on with new lyrics.
Worth scrolling to the top in this case. (Probably do it any time the lyrics change, to be honest, even if it's the same track)

Replace beacon logic

Use of the beacon API isn't really working under flakey network conditions.

Replace it with a local cache of pending network requests. Can also use the cache to apply pending modifications to data received from server.

Cast sender doesn't always load

There appears to be a race condition in how the chrome library is being loaded. Look for a different approach so it consistently loads in the correct order.

Move to ES Modules

Currently uses commonjs. Switch to ES modules for consistency with other apps.

May want to switch from browserify to webpack for build step as part of this.

For example of something already doing this, see lucos_notes v2.

Catch fetch errors in server side code.

Currently some failing fetch errors in v3.js throw uncaught exceptions which cause the whole app to crash.

Example log:

/usr/src/app/node_modules/node-fetch/lib/index.js:1461
			reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
			       ^
FetchError: request to https://ceol.l42.eu/poll/summary failed, reason: getaddrinfo EAI_AGAIN ceol.l42.eu
    at ClientRequest.<anonymous> (/usr/src/app/node_modules/node-fetch/lib/index.js:1461:11)
    at ClientRequest.emit (node:events:394:28)
    at TLSSocket.socketErrorListener (node:_http_client:447:9)
    at TLSSocket.emit (node:events:394:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  type: 'system',
  errno: 'EAI_AGAIN',
  code: 'EAI_AGAIN'
}

Catch error from native fetch

Moving to native fetch instead of node-fetch module seems to have resulted in HTTP errors causing the server to crash.

App listening on port 3001
(node:20) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
node:internal/deps/undici/undici:6970
            fetchParams.controller.controller.error(new TypeError("terminated", {
                                                    ^

TypeError: terminated
    at Fetch.onAborted (node:internal/deps/undici/undici:6970:53)
    at Fetch.emit (node:events:513:28)
    at Fetch.terminate (node:internal/deps/undici/undici:6223:14)
    at Object.onError (node:internal/deps/undici/undici:7061:36)
    at Request.onError (node:internal/deps/undici/undici:2550:31)
    at errorRequest (node:internal/deps/undici/undici:4461:17)
    at TLSSocket.onSocketClose (node:internal/deps/undici/undici:3923:9)
    at TLSSocket.emit (node:events:525:35)
    at node:net:757:14
    at TCP.done (node:_tls_wrap:583:7) {
  [cause]: SocketError: other side closed
      at TLSSocket.onSocketEnd (node:internal/deps/undici/undici:3905:26)
      at TLSSocket.emit (node:events:525:35)
      at endReadableNT (node:internal/streams/readable:1359:12)
      at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
    code: 'UND_ERR_SOCKET',
    socket: {
      localAddress: '172.27.0.2',
      localPort: 44532,
      remoteAddress: '178.32.218.44',
      remotePort: 443,
      remoteFamily: 'IPv4',
      timeout: undefined,
      bytesWritten: 184,
      bytesRead: 216
    }
  }
}

Node.js v18.7.0

Rename project

All other media projects begin with lucos_media_ - align to that for consistency

Chromecast crashes when using service worker

Since service worker has been added, the player consistently crashes on chromecast devices.

Look into the best way to avoid this (it might be some sort of feature detection to prevent service workers being used on chromecast).

It's made trickier because:

  • I've got no access to the logs when a chromecast crashes
  • Am not sure how to remove a service worker from an existing device which has one installed on it if that device crashes as soon as it loads.

Improve playback point when switching devices

At the moment, when switching devices, playback resumes from the last time the previous device sent a message to the server.
This is fine if the previous device is the one instigating the device switch, as the device switch message includes the latest update. But for other devices, there can be a fair bit of lag between these times.

Console error on start up

Each time on start, the following error is shown in the console:
image

Seems to continue working fine, so worth understanding what's causing the error and what can be done to avoid it.

`fetching` state not shown in UI when happens in Service Worker

The state of a track can be fetching either because the page itself is fetching it, or the service worker is preloading it.
For direct requests from the page, these show up with a "fetching" state in the UI. However, fetches from the service worker appear to still show as "unloaded" then jump straight to "downloaded" when they're completed.

device id not sent from service worker

Poll requests from the service worker aren't send the device's uuid. This mean the server doesn't register the device as active, so it doesn't show up on other devices' device lists (unless it's the one currently playing)

Players running during lucos_media_manager restart disappear from device list.

When lucos_media_manager gets restarted (eg on deploy) it loses its device list as it has no persistence. This is normally fine as players will register their presence when they next connect to it. However if a player is already connected, it appears it doesn't get added to the device list until the player is refreshed.

Use auth module.

Authentication would prevent others randomly changing track.

It could also be built upon to allow each user to have their own playlist.

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.