This week I continued working on the Rise Media Player open-source project, and have also been doing a React front-end application from scratch to enforce my skills in this technology (and also because is fun).
M3U Playlist format
As I said before, working with Rise Media Player gives me a better perspective of how the folders and archives work inside of a computer and how they are read by a program (or at least in Windows).
Even though I didn’t directly work on the feature of the playlist, I discover that is a standard format for saving playlists and those playlists are compatible between applications.
Originally it was introduced by Winamp, but with time other applications start to use this format like Windows Media Player, VLC, or iTunes.
The file is just a simple text with 3 values: duration (in seconds), name, and file location, all these delimited by the word ” #EXTINF”.
#EXTINF:156,Megalovania
C:\Documents and Settings\erick\My Music\Megalovania.mp3
Creating a REACT app
This week I was been practicing making a new project of react from scratch.
I learn a lot more about how it works and also, I encounter some problems while I create the project.
The first issue that I encountered, was that the command for generating a new project wasn’t working, it throws an error in the version, but the problem was totally different.
After searching I encounter that the cache of the “npx” should be cleaned to fix the error that I was having.
The command for generate a new react project is:
npx create-react-app my-app
And the command for clear the cache is:
npx clear-npx-cache
Consuming an API without libraries (in JavaScript)
Is very common for the react apps to use the library of “axios” to consume and make requests to APIs, but in one job interview, my interviewer asked me if I know the way of making that without a library.
I didn’t know the answer, so, I decided to find out how to make it.
It’s actually very easy to do and can save you a lot of time indeed if you only want to make simple GET requests.
This is simply done with the function fetch(“some URL”), but be careful with the CORS errors!
For more information, you can visit the Mozilla documentation about fetch.