ankidroid / Anki-Android

AnkiDroid: Anki flashcards on Android. Your secret trick to achieve superhuman information retention.
GNU General Public License v3.0
8.52k stars 2.21k forks source link

.Avi files not playing #15772

Closed NameLessGO closed 7 months ago

NameLessGO commented 7 months ago
Reproduction Steps
  1. Insert .avi (file used: sample avi files)
  2. Preview Card
Expected Result

Load the video

Actual Result

image First field: .avi Second field: .mp4

Debug info

2.18alpha2 Samsung S21

Research

Enter an [x] character to confirm the points below:

Additional

This was reported in Forum

The card on android has never been able to play avi videos (it won't sync over, I imported the avi video into the "collection.media" folder on android, and it won't play it either).

Today I inserted an occasional mp4 video on my computer, and suddenly found that it could be synchronized to android and played without any problem. I would like to ask, does android have any special rules for synchronizing audio and video?

The formats I've encountered are wav, mp3, mp4, avi. I found that mp4, wav can sync itself to the phone, while avi can't, and mp3 seems to be able to sync as well.

Context Code
    fun `parseSourcesToFileScheme - object`() {
        val mediaDir = "storage/emulated/0/AnkiDroid/collection.media"
        val result = parseSourcesToFileScheme("<object data=\"ben.avi\"></object>", mediaDir)
        assertEquals("""<object data="file:///$mediaDir/ben.avi"></object>""", result)```

// not in libAnki
object Sound {
    val VIDEO_EXTENSIONS = setOf("mp4", "mov", "mpg", "mpeg", "mkv", "avi")
david-allison commented 7 months ago

@NameLessGO is it feasible for you to attach a sample apkg?

NameLessGO commented 7 months ago

It is not possible in GitHub, sent via Discord

Try again with GIF, JPEG, JPG, MOV, MP4, PNG, SVG, WEBM, CPUPROFILE, CSV, DMP, DOCX, FODG, FODP, FODS, FODT, GZ, JSON, JSONC, LOG, MD, ODF, ODG, ODP, ODS, ODT, PATCH, PDF, PPTX, TGZ, TXT, XLS, XLSX or ZIP.

The media file was picked from Files Samples

david-allison commented 7 months ago

You can attach a zip