Skip to content

add ability to handle swf and some audio files#679

Merged
Adamantcheese merged 12 commits into
Adamantcheese:multi-featurefrom
Lolzen:mp3-swf
Feb 23, 2020
Merged

add ability to handle swf and some audio files#679
Adamantcheese merged 12 commits into
Adamantcheese:multi-featurefrom
Lolzen:mp3-swf

Conversation

@Lolzen

@Lolzen Lolzen commented Feb 19, 2020

Copy link
Copy Markdown

based on 462029b
Neither swf nor mp3's can be handled internally but still be downloaded.

Goes hand in hand with 420chan's /m/ & /f/ boards which support uploading these file types.
Surely there are other imageboards out there which support them aswell.

@TacoTheDank

Copy link
Copy Markdown

I support adding support for 4chan's flash board. Even if I can't view the files, I still like to read the posts.

@Adamantcheese

Copy link
Copy Markdown
Owner

MP3 files are actually playable with Exoplayer along with some other types of audio files, so if you want to add in code to handle that instead of displaying a toast, that would be good. See https://exoplayer.dev/progressive.html; also you might want to add to the image inlining code to allow those types of files to be hotlinked.

@Lolzen

Lolzen commented Feb 20, 2020

Copy link
Copy Markdown
Author

Is using the existing VIDEO mode for mp3 acceptable?

@Adamantcheese

Copy link
Copy Markdown
Owner

Yep, I believe that would work fine.

@Lolzen

Lolzen commented Feb 20, 2020

Copy link
Copy Markdown
Author

could you point me to the image inlining commit? i have trouble finding it.

@Adamantcheese

Copy link
Copy Markdown
Owner

You should only need to modify this regex pattern for hotlinking: https://github.com/Adamantcheese/Kuroba/blob/multi-feature/Kuroba/app/src/main/java/com/github/adamantcheese/chan/core/site/parser/CommentParserHelper.java#L76
The actual hotlinking code is addPostImages in the same class, if you want to look at it.

@Lolzen

Lolzen commented Feb 20, 2020

Copy link
Copy Markdown
Author

Thanks!

@Lolzen

Lolzen commented Feb 20, 2020

Copy link
Copy Markdown
Author

Should we enable /f/ as requested by TacoTheDank while we're at it?

@Adamantcheese

Copy link
Copy Markdown
Owner

Yeah, the bits that need removing are in Chan4BoardsRequest.

@Lolzen

Lolzen commented Feb 20, 2020

Copy link
Copy Markdown
Author

One last thing. Should i add the same thumbnail for swf files on 4chan as i did for 420chan, or do you want to handle that different/yourself?

@Adamantcheese

Copy link
Copy Markdown
Owner

Sure, I'll make them internal to the project when I merge it anyways (using that raw.githubusercontent style link). It'll remind me to do that.

@Pentaphon

Pentaphon commented Feb 21, 2020

Copy link
Copy Markdown

/m/ supports: Supported file types are: AAC, FLAC, GIF, JPG, M4A, MP3, NSF, OGG, PNG, SPC, WEBM

Is this going to support the files that Exoplayer can play as well?

@Adamantcheese

Copy link
Copy Markdown
Owner

AAC, NSF, SPC aren't supported by Exoplayer.
FLAC can be with an extension it looks like.
GIF, JPG, PNG, and WEBM are already supported.
M4A, MP3, OGG are supportable as well.
If Lolzen wants to add that stuff in I wouldn't mind.

@Pentaphon

Copy link
Copy Markdown

FLAC can be with an extension it looks like.
M4A, MP3, OGG are supportable as well.
If Lolzen wants to add that stuff in I wouldn't mind.

In that case, @Lolzen I humbly request you support those as well. They may not be as commonly used as mp3 but it would be nice for FLAC, OGG and M4A to "just work" when we come across them.

@Lolzen

Lolzen commented Feb 21, 2020

Copy link
Copy Markdown
Author

Sure thing.
M4A is working in my test, whereas ogg vorbis is throwing an error. FLAC i have to look into later.

@Lolzen

Lolzen commented Feb 22, 2020

Copy link
Copy Markdown
Author

So it seems the flac extension has to be built from source according to https://github.com/google/ExoPlayer/blob/release-v2/README.md

I'll personally pass on that one, as i don't really know how i would have to handle that with the gradle stuff.

Regarding ogg - i have to tinker around a bit more. "Loading finished before preparation is complete"

@Pentaphon

Copy link
Copy Markdown

So it seems the flac extension has to be built from source according to https://github.com/google/ExoPlayer/blob/release-v2/README.md

Apparently you don't need that extension anymore with the latest Exoplayer running on Android O MR1 and above devices since that version started shipping with a FLAC decoder.

google/ExoPlayer#6406

Just something to consider in the future. Probably not something you want to do for this PR just yet, or at least until we get to the latest Exoplayer 2.11.3

Thanks for M4A and OGG. Lossy codec support is probably enough for now anyway.

@Lolzen

Lolzen commented Feb 22, 2020

Copy link
Copy Markdown
Author

allright. tested both flac & ogg and can cofirm them working.
the one ogg file which i was testing stil refuses to play, but another testfile was working without issues.
(https://boards.420chan.org/m/thread/454348#456297)
(https://boards.420chan.org/m/thread/454348#456298)

Hope it's a special case with https://boards.420chan.org/m/thread/454348#456286

On a side note i think it would be well to use a simple general "audio" thumbnail for audio fileTypes.
Also we could add the other not viewable filetypes and generalize PDF integration so mediatype OTHER will add a toast message "File not viewable[...]" and use a generalized "view not supported" thumbnail for these and future ones. Just an idea.
something along these:
supported file (can view; audio): https://www.pngrepo.com/svg/256698/file-document
unsupported file (can't view): https://www.pngrepo.com/svg/256712/file-error
these would be my choice, but style is very subjective.

@Lolzen Lolzen changed the title add ability to handle mp3 & swf files add ability to handle swf and some audio files Feb 22, 2020
Adamantcheese added a commit that referenced this pull request Feb 23, 2020
@Adamantcheese Adamantcheese merged commit 60b4e12 into Adamantcheese:multi-feature Feb 23, 2020
@Pentaphon

Copy link
Copy Markdown

Hope it's a special case with https://boards.420chan.org/m/thread/454348#456286

Thanks for getting FLAC too! I think this might indeed be a special case because looking at the file properties, it was encoded with Lavc52.79.1 with Xiph.Org libVorbis I 20070622 so that is quite old. Might be worth sending that to the Exoplayer team. Or maybe a newer Exoplayer already fixed playback of such ogg files.

Adamantcheese added a commit that referenced this pull request Feb 27, 2020
…s available for a file

Adjust some MultiImageView code to better use ExoPlayer 2 conventions; audio should no longer pop when playback begins if you have mute-by-default on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants