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

Android系统特定pag文件播放无法加速 #2516

Open
zeinx920 opened this issue Oct 9, 2024 · 2 comments
Open

Android系统特定pag文件播放无法加速 #2516

zeinx920 opened this issue Oct 9, 2024 · 2 comments
Assignees

Comments

@zeinx920
Copy link
Contributor

zeinx920 commented Oct 9, 2024

主仓库main分支Android端demo,特定pag文件无法实现加速播放,其他pag文件正常,代码调整如下,testfile.pag见附件:

private void addPAGViewAndPlay() {
        if (pagView == null) {
            pagView = new PAGView(this, eglContext);
            pagView.addListener(this);
            pagView.setLayoutParams(new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));

            PAGFile pagFile = PAGFile.Load(getAssets(),“testfile.pag”);
            pagFile.setDuration(pagFile.duration() / 3);
            pagFile.setTimeStretchMode(PAGTimeStretchMode.Scale);
            pagView.setComposition(pagFile);
            pagView.setRepeatCount(1);
            pagView.setOnClickListener(v -> {
                if (pagView.isPlaying()) {
                    pagView.pause();
                } else {
                    pagView.play();
                }
            });
            containerView.addView(pagView);
            pagView.play();
        }
    }

【版本信息】

PAG版本:4.2.88

【平台信息】

Android 原生
image

【预期的表现】

可以正常加速

【实际的情况】

无法加速

【Demo及附件】

testfile.pag.zip

@kevingpqi123
Copy link
Collaborator

kevingpqi123 commented Oct 14, 2024

https://pag.io/docs/time-stretch.html

伸缩模式有一个拉伸区间,伸缩的是拉伸区间,拉伸区间外的内容是不会拉伸的,你这里应该是拉伸区间是空的

@zeinx920
Copy link
Contributor Author

https://pag.io/docs/time-stretch.html

伸缩模式有一个拉伸区间,伸缩的是拉伸区间,拉伸区间外的内容是不会拉伸的,你这里应该是拉伸区间是空的

了解,有api可以获取到这个拉伸区间吗

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

2 participants