Adding supported file extensions

This commit is contained in:
Hardcore Sushi 2020-09-05 10:27:42 +02:00
parent bad270851f
commit ef83e1c1fc
2 changed files with 7 additions and 7 deletions

View File

@ -13,10 +13,10 @@ class ConstValues {
const val wipe_passes = 2
const val slideshow_delay: Long = 4000
private val fileExtensions = mapOf(
Pair("image", listOf("png", "jpg", "jpeg")),
Pair("video", listOf("mp4", "webm")),
Pair("audio", listOf("mp3", "ogg")),
Pair("text", listOf("txt", "json", "conf", "log", "xml", "java", "kt", "py", "go", "c", "h", "cpp", "hpp", "sh", "js", "html", "css", "php"))
Pair("image", listOf("png", "jpg", "jpeg", "gif", "bmp")),
Pair("video", listOf("mp4", "webm", "mkv", "mov")),
Pair("audio", listOf("mp3", "ogg", "m4a", "wav", "flac")),
Pair("text", listOf("txt", "json", "conf", "log", "xml", "java", "kt", "py", "pl", "rb", "go", "c", "h", "cpp", "hpp", "sh", "bat", "js", "html", "css", "php", "yml", "yaml", "ini", "md"))
)
fun isImage(path: String): Boolean {

View File

@ -6,7 +6,7 @@ import com.google.android.exoplayer2.ExoPlaybackException
import com.google.android.exoplayer2.Player
import com.google.android.exoplayer2.SimpleExoPlayer
import com.google.android.exoplayer2.extractor.ExtractorsFactory
import com.google.android.exoplayer2.extractor.flv.FlvExtractor
import com.google.android.exoplayer2.extractor.flac.FlacExtractor
import com.google.android.exoplayer2.extractor.mkv.MatroskaExtractor
import com.google.android.exoplayer2.extractor.mp3.Mp3Extractor
import com.google.android.exoplayer2.extractor.mp4.Mp4Extractor
@ -46,9 +46,9 @@ abstract class MediaPlayer: FileViewerActivity() {
MatroskaExtractor(),
Mp4Extractor(),
Mp3Extractor(),
FlvExtractor(),
OggExtractor(),
WavExtractor()
WavExtractor(),
FlacExtractor()
)
}).createMediaSource(ConstValues.fakeUri)
player.seekTo(currentWindow, playbackPosition)