Show subtitles - MX Player

Hello!
I'm developing an App and i have to open MX Player with a video and a subtitle file.
I use this code:
Intent intent = new Intent(Intent.ACTION_VIEW);
Parcelable[] parcels = {Uri.parse(fullFileName)};
Parcelable[] parcelsSub = {Uri.parse(fullFileName)};
String[] names = {"Sottotitoli"};
intent.setDataAndType(Uri.parse(fileVideoPath), "video/mp4");
intent.setPackage("com.mxtech.videoplayer.ad");
intent.setClassName("com.mxtech.videoplayer.ad", "com.mxtech.videoplayer.ad.ActivityScreen");
intent.putExtra("subs", parcels);
intent.putExtra("subs.enable", parcelsSub);
intent.putExtra("subs.name", names);
startActivity(intent);
The subtitiles are shown in Subtitles > Panels, but i have to check if i want to show them. I want that this subtitles are automatically shown when i start mxplayer.

Would you check if subtitle has correct scheme?
If URI is pointing a file, URI should have 'file' scheme, such as file:///sdcard/sub.srt

Yes, it works! There wasn't "file://". I didn't find anywhere this so thank you!

Can mxplayer skip from sub to sub? example: i have two subtitles, one starts at 10 second and the other at 30 seconds. Can i skip from 10 seconds to 30 seconds?

PiraLezz said:
Can mxplayer skip from sub to sub? example: i have two subtitles, one starts at 10 second and the other at 30 seconds. Can i skip from 10 seconds to 30 seconds?
Click to expand...
Click to collapse
Just tap on subtitle text & swipe.
It will ff or rw to the next/previous subtitle position.
Kindly keep in mind that if you enabled fast seeking, then it will move to nearast key frame from the next subtitle position instead of exact subtitle position.

Thanks a lot! it works. But there is another problem . Our app can be runned also in a vuzix m100, that is a smart glasses and it has only 3 buttons as input. So we can't skip subtitles in there. I would know if in the future you will add a feature that you can choose the buttons behaviour...

Related

[Q] First time playing MKV type anime and I'm wondering if I'm using subtitles right.

I have a GPad 7.0 and I downloaded MX Player just today and transferred over a couple anime episodes. After tinkering with it a bit, I have only found one way to turn on subtitles, and that is to:
1. Start the video
2. Select the (...) more button
3. Select "Subtitle."
4. Select "Panel"
5. A window appears at the bottom saying Track 1 with a checkbox. I check it.
6. The tablet says to wait as it prepares a text cache of some sort.
7. Subtitles work perfectly, but only for that episode. After which, after switching to a new episode, I have to repeat this process.
Is there an easier way to do this or will I have to manually "load" the subtitles between every video file?
Tick "Enable embedded subtitles" in the (Tools ->) Settings -> Subtitle.
ASimpleLotus said:
I have a GPad 7.0 and I downloaded MX Player just today and transferred over a couple anime episodes. After tinkering with it a bit, I have only found one way to turn on subtitles, and that is to:
1. Start the video
2. Select the (...) more button
3. Select "Subtitle."
4. Select "Panel"
5. A window appears at the bottom saying Track 1 with a checkbox. I check it.
6. The tablet says to wait as it prepares a text cache of some sort.
7. Subtitles work perfectly, but only for that episode. After which, after switching to a new episode, I have to repeat this process.
Is there an easier way to do this or will I have to manually "load" the subtitles between every video file?
Click to expand...
Click to collapse
If it's a embedded one, the solution of @vivan000 will work for you.
If it's the external one, kindly ensure that file name of subtitle is same as the video file name. Otherwise it won't be listed automatically. You may have to manually open.
vivan000 said:
Tick "Enable embedded subtitles" in the (Tools ->) Settings -> Subtitle.
Click to expand...
Click to collapse
This.

[Q] Search/navigate next/previous subtitle

I am looking for a way (button/gesture) to jump forward/back in time to the next/previous position where a subtitle text was displayed.
This is intended to be used when subtitles are displayed in a language one is not all that familiar with (studying). When you need to re-read a text it is difficult to move the correct number of seconds, so a jump-to-subtitle button would be useful.
That already exists; you can swipe forwards/backwards on teh subs itself, and it should seek by subtitle.

Bug: subtitles disappears

Steps to reproduce:
* Pause MX Player while it is displaying a subtitle text
* Switch to another app (e.g. in order to type the subtitle text into google translate)
* Switch back to MX player
==> The video is still stopped where it should be, but the subtitle text is missing
(Found on LG G3/Android 5)
drhex said:
Steps to reproduce:
* Pause MX Player while it is displaying a subtitle text
* Switch to another app (e.g. in order to type the subtitle text into google translate)
* Switch back to MX player
==> The video is still stopped where it should be, but the subtitle text is missing
(Found on LG G3/Android 5)
Click to expand...
Click to collapse
BTW, from where you are opening the video..?
Can you collect the logs & upload here immediately after reproducing the issue?
Sent from my SM-G900H using Tapatalk
The video is an .mkv-file opened from an "external SD card".
Testing some more, I notice that the video is not always back to the exact moment where I paused it, when returning to MX Player from another app, there may be ~2 seconds difference.
But even in those cases when video is back to what looks like the exact frame where it was paused, the subtitle text is gone.
Log attached.
This is generally a function of the old subtitle rendering mechanism. To be certain, it's only the current sub line that's gone right? Ie, when you play the video, the next subs still appear?
If you try the beta version, which has a new SW subtitle rendering engine, this should be improved.
https://sites.google.com/site/mxvpen/translation/test-build
Tried the latest 1.8.4 nightly, and now the subtitles seems to be displayed correctly when resuming (but it hardly ever resumes where it was stopped, but about 1 second earlier).
drhex said:
Tried the latest 1.8.4 nightly, and now the subtitles seems to be displayed correctly when resuming (but it hardly ever resumes where it was stopped, but about 1 second earlier).
Click to expand...
Click to collapse
Go to Setting- Player and disable fast seeking. Then the player will find the exact frame.

Subtitles sync

ok, this is my idea to sync subtitles - based on solution in AllPlayer:
I pause movie in position when should be text, open window with all subtitles, chose one and press button "This Text in This Position" - this solution is from AllPlayer.
Second, optional part if subtitles have diffrent framerate:
Go to some part at end of movie, pause, and set second text for this moment like above. MX Palyer based on this two point calculate new positions for every text

[Bug] Offline Subtitle error

Hello,
There’s a subtitle error that happens every time I swap from the mx player app to another app while a video is opened, or when I close the phone screen,
When I return back to the said opened video (on device offline video), and try to fast backward in the video, the subtitle (which is also offline) doesn’t show up on the entire section before the resumed part,
And even when I try to swipe on the subtitle itself backward, it acts like the resumed part is where the subtitle actually begins,
I’m currently using the last version of mx player free (1.22.8)
And I’m using redmi note 8 phone.
Thanks for any suggestions or help !

Categories

Resources