Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mpv scrips not working in android 13 and 14 #1579

Closed
8 tasks done
P0bo opened this issue May 16, 2024 · 15 comments
Closed
8 tasks done

Mpv scrips not working in android 13 and 14 #1579

P0bo opened this issue May 16, 2024 · 15 comments

Comments

@P0bo
Copy link

P0bo commented May 16, 2024

Steps to reproduce

I have been using this script in my android 10 Lenovo tablet to skip openings of untracked local animes, however when I tried this in android 14 OnePlus tablet it doesnt seem to work , both devices are running r7540

local opts = {
    skip_min_length = 80,  -- Minimum chapter length to skip (in seconds)
    skip_max_length = 90,  -- Maximum chapter length to skip (in seconds)
}
-- No need for options.read_options(opts) since we define them here

function get_chapter_time(index)
    return mp.get_property_number("chapter-list/" .. index .. "/time")
end

function skip_chapters()
    local current_chapter = mp.get_property_number("chapter")
    local chapter_count = mp.get_property_number("chapter-list/count")

    if not current_chapter or not chapter_count then return end

    local current_chapter_time = get_chapter_time(current_chapter)
    local next_chapter_time = get_chapter_time(current_chapter + 1)

    if not current_chapter_time or not next_chapter_time then return end

    local chapter_length = next_chapter_time - current_chapter_time

    if chapter_length >= opts.skip_min_length and chapter_length <= opts.skip_max_length then
        local chapter_title = mp.get_property("chapter-list/" .. current_chapter .. "/title") or "Unknown"
        mp.set_property_number("chapter", current_chapter + 1)
        mp.osd_message("Skipped chapter: " .. chapter_title, 2)  -- Display message for 2 seconds
    end
end

mp.observe_property("chapter", "number", function(name, value)
    if value then
        skip_chapters()
    end
end) 

I have placed the script file in aniyomi scripts folder in both devices and used same video file for testing.

Screenshot_2024-05-17-01-20-41-96_e24af01bec3189413074866d0f854b7c

Expected behavior (Lenovo tablet)
video

Version info

  • Lenovo tab (script working)
    App version: 0.15.3.0-7540 (standard, 9c30b36, 123, 2024-05-15T00:59Z)
    Android version: 10 (SDK 29; build TB-8505F_S301106_230914_BMP)
    Android build ID: TB-8505F_S301106_230914_BMP
    Device brand: Lenovo
    Device manufacturer: LENOVO
    Device name: 8505F (LenovoTB-8505F)
    Device model: Lenovo TB-8505F
    WebView: Android System WebView 122.0.6261.119
    MPV version: 4d32db2
    Libplacebo version: v7.349.0
    FFmpeg version: n7.0

  • OnePlus Pad (script not working)
    App version: 0.15.3.0-7540 (standard, 9c30b36, 123, 2024-05-15T00:59Z)
    Android version: 14 (SDK 34; build OPD2203_14.0.0.600(EX01))
    Android build ID: OPD2203_14.0.0.600(EX01)
    Device brand: OnePlus
    Device manufacturer: OnePlus
    Device name: OP59BCL1 (OPD2203)
    Device model: OPD2203
    WebView: Android System WebView 123.0.6312.99
    MPV version: 4d32db2
    Libplacebo version: v7.349.0
    FFmpeg version: n7.0

  • Poco X3 pro (script not working)
    App version: 0.15.3.0-7540 (standard, 9c30b36, 123, 2024-05-15T00:59Z)
    Android version: 13 (SDK 33; build TKQ1.221013.002 test-keys)
    Android build ID: TKQ1.221013.002 test-keys
    Device brand: POCO
    Device manufacturer: Xiaomi
    Device name: bhima (bhima_in)
    Device model: M2102J20SI
    WebView: Android System WebView 124.0.6367.123
    MPV version: 4d32db2
    Libplacebo version: v7.349.0
    FFmpeg version: n7.0

Expected behavior

The script should work on all three devices

Actual behavior

Not Working on 2 Devices

Crash logs

No response

Aniyomi version

0.15.3.0-7540

Android version

Android 10 (Lenovo tab),Android 13 (Poco X3 pro),Android 14 (OnePlus Pad))

Device

Lenovo tab M10 HD,OnePlus Pad,Poco X3 pro

Other details

No response

Acknowledgements

  • I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open or closed issue.
  • I have written a short but informative title.
  • If this is an issue with an official extension, I should be opening an issue in the extensions repository.
  • If this is an issue with an official manga extension and this issue can be replicated in the Tachiyomi app, that I should be opening an issue in Tachiyomi's extensions repository.
  • I have gone through the FAQ and troubleshooting guide.
  • I have updated the app to version 0.15.3.0.
  • I have updated all installed extensions.
  • I will fill out all of the requested information in this form.
@jmir1
Copy link
Member

jmir1 commented May 16, 2024

Can you try it with r7493?

@P0bo
Copy link
Author

P0bo commented May 16, 2024

@jmir1 r7493 also doesnt work

@Bubblekey
Copy link

Yep same , please look into this , i have been trying to find a solution from last month after i changed my phone ,i thought it was my phones fault 😞.
The scripts save a lot of time for me .

@Luffyirl
Copy link

Luffyirl commented May 16, 2024

I think it may have something to do with the file access changes that Google made in Android 12(iirc) .

@Luffyirl
Copy link

I myself have been troubled by the fact that scripts doesn't work anymore but i remember i somehow made them work some versions before . A fix would be really appreciated.

@jmir1
Copy link
Member

jmir1 commented May 16, 2024

I think it may have something to do with the file access changes that Google made in Android 12(iirc) .

That's true, what I can't figure out is why scripts used to work for me like 3 months ago but not now, also on android 13...

@Ripl0gic
Copy link

I think it may have something to do with the file access changes that Google made in Android 12(iirc) .

That's true, what I can't figure out is why scripts used to work for me like 3 months ago but not now, also on android 13...

I remember some guy asking in discord server like 3 months ago for blur-edges.lua . It was working for u or prolly quicky (i dont remember correctly) but the guy couldn't get it to work . In the end he gave up

@Ripl0gic
Copy link

Is this issue gonna get a fix or is it like a low priority feature ? I also use scripts on my tablet (android 11) but I'm thinking of buying a new one , it will be really inconvenient if I can't use scripts.

@jmir1
Copy link
Member

jmir1 commented May 17, 2024

Is this issue gonna get a fix or is it like a low priority feature ? I also use scripts on my tablet (android 11) but I'm thinking of buying a new one , it will be really inconvenient if I can't use scripts.

I definitely want to fix it

@cauxar
Copy link

cauxar commented May 17, 2024

I definitely want to fix it

Damn u were dev , i thought u were some guy who got frustrated that ur scripts were not working anymore like me .

Fix will be really appreciated ♥️

@jmir1
Copy link
Member

jmir1 commented May 17, 2024

Okay, so I managed to get scripts working by adding a new permission to manage all external files.
What you need to do is:

  1. Download and install the latest prerelease from here
  2. Adjust you folder structure: Move your "scripts", "script-opts" and "fonts" directories into a directory called "mpv-config"
  3. Go to Settings -> Player -> Advanced player settings, switch on "Enable MPV scripts" and allow the permission
  4. Profit (hopefully)

Please tell me if this works for you all.

@sBaydin
Copy link

sBaydin commented May 17, 2024

@jmir1 is a hero 🦸

@jmir1
Copy link
Member

jmir1 commented May 28, 2024

Didn't get much feedback but the fix worked for the person who opened the issue, so closing this for now.

@jmir1 jmir1 closed this as completed May 28, 2024
@Luffyirl
Copy link

Didn't get much feedback but the fix worked for the person who opened the issue, so closing this for now.

Actually this was really helpful for me too , thankyou very much for the fix .

@cauxar
Copy link

cauxar commented Jun 1, 2024

Didn't get much feedback but the fix worked for the person who opened the issue, so closing this for now.

It worked for me to , really appreciate ur work . Love u ♥️♥️♥️

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

No branches or pull requests

7 participants