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

feat(ID3): decode APIC frames #5857

Merged
merged 4 commits into from
Nov 6, 2023
Merged

feat(ID3): decode APIC frames #5857

merged 4 commits into from
Nov 6, 2023

Conversation

pszemus
Copy link
Contributor

@pszemus pszemus commented Nov 3, 2023

Since the official ID3 site (https://id3.org) is not available, I used a mirror (https://mutagen-specs.readthedocs.io/en/latest/id3/id3v2.4.0-frames.html#apic) to implement the decoding of APIC frames.

@shaka-bot
Copy link
Collaborator

shaka-bot commented Nov 4, 2023

Incremental code coverage: 88.00%

@avelad
Copy link
Collaborator

avelad commented Nov 5, 2023

@pszemus can you provide a sample stream to test the code? Thanks!

@pszemus
Copy link
Contributor Author

pszemus commented Nov 5, 2023

Here's a sample live HLS stream: https://stream-cdn-1.open.fm/OFM18/ngrp:standard/playlist.m3u8 with ID3 frames inserted at each song change: TIT2, TLEN, WOAF and APIC

In this stream, each APIC frame contains the following informationf:

Above should map to the following metadata object being thrown:

{
    "key": "APIC",
    "description": "",
    "data": "https://open-fm.wpcdn.pl/cover/c4a07f00000100000000000000005df37761082777840000",
    "pictureType": 3,
    "mimeType": "-->"
}

and it does, according to unit tests I wrote.

What bothers me is why Shaka Player replaces the pictureType field name set in id3_utils.js with ph in the metadata object (in my build), leaving mimeType, description and data field names unchanged. The metadata is logged as follows:

player.addEventListener('metadata', (e) => {
   console.log("[t: " + player.getMediaElement().currentTime + "] MetadataEvent event", e.payload);
});

and the result of the parsed APIC frame:

{
    "key": "APIC",
    "description": "",
    "data": "https://open-fm.wpcdn.pl/cover/c4a07f00000100000000000000005df37761082777840000",
    "ph": 3,
    "mimeType": "-->"
}

@avelad avelad added type: enhancement New feature or request priority: P3 Useful but not urgent labels Nov 6, 2023
@avelad avelad added this to the v4.6 milestone Nov 6, 2023
@avelad
Copy link
Collaborator

avelad commented Nov 6, 2023

@pszemus I fixed the problem. Thanks for your PR!

@avelad avelad merged commit 6a862d2 into shaka-project:main Nov 6, 2023
13 of 15 checks passed
Robloche pushed a commit to Robloche/shaka-player that referenced this pull request Nov 30, 2023
Since the official ID3 site (https://id3.org) is not available, I used a
mirror
(https://mutagen-specs.readthedocs.io/en/latest/id3/id3v2.4.0-frames.html#apic)
to implement the decoding of APIC frames.

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Jan 5, 2024
@shaka-project shaka-project locked as resolved and limited conversation to collaborators Jan 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: P3 Useful but not urgent status: archived Archived and locked; will not be updated type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants