Giter Club home page Giter Club logo

Comments (7)

davwheat avatar davwheat commented on July 22, 2024

I'll try to look into a fix for this... Essentially, builds were taking far too long on Cloudflare and I was also worried about hitting storage and file count limitations on Cloudflare Pages, hence moving the audio to separate storage.

You might be able to use something like Python's simple web server by running it in the audio/ folder and updating the audio URL prefix in the source code for now.

cd audio
python3 -m http.server 9000

Then update the following lines:

generateAudioFileUrl(fileId: string, customPrefix?: string): string {
return `https://cdn.railannouncements.co.uk/${customPrefix || this.FILE_PREFIX}/${this.processAudioFileId(fileId).replace(/\./g, '/')}.mp3`
}

to:

  generateAudioFileUrl(fileId: string, customPrefix?: string): string {
    return `http://localhost:9000/${customPrefix || this.FILE_PREFIX}/${this.processAudioFileId(fileId).replace(/\./g, '/')}.mp3`
  }

from rail-announcements.

opott avatar opott commented on July 22, 2024

@davwheat
Just tried your suggested fix, but no luck.

I get this error on the site:
image

And this error in the Python terminal:

@opott ➜ /workspaces/rail-announcements/audio (main) $ python3 -m http.server 9000
Serving HTTP on 0.0.0.0 port 9000 (http://0.0.0.0:9000/) ...
127.0.0.1 - - [16/Jun/2024 12:32:11] code 501, message Unsupported method ('OPTIONS')
127.0.0.1 - - [16/Jun/2024 12:32:11] "OPTIONS /SN/377/bing%20bong.mp3 HTTP/1.1" 501 -
127.0.0.1 - - [16/Jun/2024 12:32:11] code 501, message Unsupported method ('OPTIONS')
127.0.0.1 - - [16/Jun/2024 12:32:11] "OPTIONS /SN/377/stations/ABW.mp3 HTTP/1.1" 501 -
127.0.0.1 - - [16/Jun/2024 12:32:11] code 501, message Unsupported method ('OPTIONS')
127.0.0.1 - - [16/Jun/2024 12:32:11] "OPTIONS /SN/377/please%20mind%20the%20gap%20between%20the%20train%20and%20the%20platform.mp3 HTTP/1.1" 501 -
127.0.0.1 - - [16/Jun/2024 12:32:11] code 501, message Unsupported method ('OPTIONS')
127.0.0.1 - - [16/Jun/2024 12:32:11] "OPTIONS /SN/377/we%20are%20now%20approaching.mp3 HTTP/1.1" 501 -

from rail-announcements.

davwheat avatar davwheat commented on July 22, 2024

Sorry this took so long... This should be better now from changes in 9313af4 and 58ee9b5.

I've added some new info to the README for local development. In a nutshell, run these three in different terminals one after the other:

yarn develop
yarn develop:workers
yarn serve-audio

You can access the site on http://local.davw.network:8787 (local.davw.network points to 127.0.0.1 and is needed for CORS stuff)

Let me know if you still have issues.

from rail-announcements.

opott avatar opott commented on July 22, 2024

Hi. Not sure if I am doing something wrong here, but when I follow the steps provided and access the site, I get an error when I open a page for an announcement system.
image

However, the Celia & Phil pages appear to work properly, as well as the live trains. I am only having issues opening the pages for onboard systems and the ScotRail station system.

from rail-announcements.

davwheat avatar davwheat commented on July 22, 2024

Oh, I just broke something with my latest change. Not your fault...

from rail-announcements.

opott avatar opott commented on July 22, 2024

Oh, that's alright. I thought I was doing something wrong! 😂

from rail-announcements.

davwheat avatar davwheat commented on July 22, 2024

That should also be fixed with the latest commit

from rail-announcements.

Related Issues (20)

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.