Commit dc2f183
committed
Improve seek reliability for local M4A/MP4 files and update
- **DualPlayerEngine**: Configure `Mp4Extractor` with `FLAG_WORKAROUND_IGNORE_EDIT_LISTS` to prevent seek drift and snap-back issues caused by broken edit lists in vendor-produced M4A files.
- **MediaItemBuilder**:
- Update `playbackUri` to prefer direct file URIs over `content://` URIs for specific local audio formats (M4A, MP4, AAC, 3GP, etc.) to improve playback stability.
- Implement `shouldPreferDirectLocalFileUri` to identify when a direct file path should be used based on MIME type and file extension.
- Centralize `MediaItem` URI generation by accepting `Song` objects directly.
- **PlayerViewModel**: Update `MediaItem` creation to include MIME types and use the updated `MediaItemBuilder.playbackUri` signature.
- **Tests**:
- Add `MediaItemBuilderTest` to verify direct file URI selection logic.
- Update `PlayerViewModelTest` to match the new `playbackUri` signature.MediaItem construction1 parent 4891e65 commit dc2f183
5 files changed
Lines changed: 139 additions & 15 deletions
File tree
- app/src
- main/java/com/theveloper/pixelplay
- data/service/player
- presentation/viewmodel
- utils
- test/java/com/theveloper/pixelplay
- presentation/viewmodel
- utils
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
340 | 342 | | |
341 | 343 | | |
342 | 344 | | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
343 | 349 | | |
344 | 350 | | |
345 | 351 | | |
| |||
353 | 359 | | |
354 | 360 | | |
355 | 361 | | |
356 | | - | |
| 362 | + | |
357 | 363 | | |
358 | 364 | | |
359 | 365 | | |
| |||
Lines changed: 9 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2825 | 2825 | | |
2826 | 2826 | | |
2827 | 2827 | | |
2828 | | - | |
| 2828 | + | |
| 2829 | + | |
2829 | 2830 | | |
2830 | 2831 | | |
2831 | 2832 | | |
| |||
2898 | 2899 | | |
2899 | 2900 | | |
2900 | 2901 | | |
2901 | | - | |
| 2902 | + | |
2902 | 2903 | | |
2903 | 2904 | | |
2904 | 2905 | | |
| |||
2965 | 2966 | | |
2966 | 2967 | | |
2967 | 2968 | | |
2968 | | - | |
| 2969 | + | |
| 2970 | + | |
2969 | 2971 | | |
2970 | 2972 | | |
2971 | 2973 | | |
| |||
3037 | 3039 | | |
3038 | 3040 | | |
3039 | 3041 | | |
3040 | | - | |
| 3042 | + | |
| 3043 | + | |
3041 | 3044 | | |
3042 | 3045 | | |
3043 | 3046 | | |
| |||
3053 | 3056 | | |
3054 | 3057 | | |
3055 | 3058 | | |
3056 | | - | |
| 3059 | + | |
| 3060 | + | |
3057 | 3061 | | |
3058 | 3062 | | |
3059 | 3063 | | |
| |||
Lines changed: 82 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
16 | 38 | | |
17 | 39 | | |
18 | 40 | | |
| |||
37 | 59 | | |
38 | 60 | | |
39 | 61 | | |
40 | | - | |
| 62 | + | |
| 63 | + | |
41 | 64 | | |
42 | 65 | | |
43 | 66 | | |
44 | 67 | | |
45 | 68 | | |
46 | 69 | | |
47 | 70 | | |
48 | | - | |
| 71 | + | |
| 72 | + | |
49 | 73 | | |
50 | 74 | | |
51 | 75 | | |
| |||
55 | 79 | | |
56 | 80 | | |
57 | 81 | | |
58 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
59 | 94 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 95 | + | |
65 | 96 | | |
66 | 97 | | |
67 | 98 | | |
| |||
71 | 102 | | |
72 | 103 | | |
73 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
74 | 148 | | |
75 | 149 | | |
76 | 150 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
439 | | - | |
| 439 | + | |
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
| |||
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
0 commit comments