An offline-enabled progressive web app for listening to the FT
As of 25 Jan 2018 this app has been switched off. It was rather nice though. Hopefully it will return.
We were asked to explore whether or not FT subscribers would listen to FT content in a podcast and this is what we came up with:
Using service workers, we were able to create a web app that would function offline.
Listen to the FT works great on the web, but, with the inclusion of a manifest and a service workers, it can work even better in modern browsers/platforms. For example, on Android devices, Listen to the FT can be installed to the home screen and run fullscreen using the latest Chrome/Firefox/Samsung Internet browsers.
The inclusion of a service worker also allowed us to to download content ahead of time, so it could be listened to when a network connection isn't readily available or reliable (like travelling on the Tube)
Utilizing the newly available media session APIs, we were also able to offer more powerful media controls from the lock screen of Android devices.
npm install
npm update
Set these env vars in the shell or in a .env file
- AUDIO_ARTICLES_THING_ID=...
- AUDIO_AVAILABLE_SERVICE=...
- AUDIO_STATS_SERVICE=...
- AWS_AUDIO_BUCKET=...
- AWS_REGION=...
- CAPI_KEY=...
- DEBUG=*
- FT_API_URL=...
- MEMBERSHIP_LOGIN_API_KEY=...
- MEMBERSHIP_SESSION_API_KEY=...
- MYFT_API_KEY=...
- MYFT_API_URL=...
- RECORDED_MEDIA_FORMAT=mp3
- UPP_COCO=...
npm run prestart
npm run start
and look for http://localhost:3000/