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

Audio Delay Cause Player State Wrong #157

Closed
Paladinfeng opened this issue May 10, 2021 · 2 comments
Closed

Audio Delay Cause Player State Wrong #157

Paladinfeng opened this issue May 10, 2021 · 2 comments

Comments

@Paladinfeng
Copy link

Paladinfeng commented May 10, 2021

KSPlayerState.playedToTheEnd Not Call When Video Play Finished

Code In Demo:

let options = KSOptions()
options.audioDelay = -5
objects.append(KSPlayerResource(url: URL(fileURLWithPath: path), options: options, name: "本地视频", cover: nil, subtitleURL: nil))

To support AirPlay, I have to manually delay audio for 2s

let currentRoute = AVAudioSession.sharedInstance().currentRoute
        
for output in currentRoute.outputs {
    options.audioDelay = output.portType == .airPlay ? -2.0 : 0.0
}
@Paladinfeng
Copy link
Author

Paladinfeng commented May 17, 2021

Still has bug

func player(layer: KSPlayerLayer, currentTime: TimeInterval, totalTime: TimeInterval)

In this function, currentTime larger than totalTime if I delay audio

kingslay added a commit that referenced this issue Sep 23, 2022
@Alanko5
Copy link

Alanko5 commented Mar 6, 2023

kingslay added a commit that referenced this issue Mar 11, 2023
kingslay added a commit that referenced this issue May 7, 2023
commit 7f46543
Author: kintan <[email protected]>
Date:   Sun May 7 17:04:45 2023 +0800

    记录上次播放的时间

commit 4e7f1d8
Author: kintan <[email protected]>
Date:   Sun May 7 12:02:37 2023 +0800

    优化代码

commit f06ca66
Author: kintan <[email protected]>
Date:   Sun May 7 11:26:41 2023 +0800

    优化多窗口

commit 4ffb090
Author: kintan <[email protected]>
Date:   Sun May 7 10:16:00 2023 +0800

    fix crash

commit e7e1252
Author: kintan <[email protected]>
Date:   Sun May 7 10:12:18 2023 +0800

    优化代码

commit 1644d18
Author: kintan <[email protected]>
Date:   Sat May 6 23:41:05 2023 +0800

    优化代码

commit 1ace630
Author: kintan <[email protected]>
Date:   Sat May 6 22:34:06 2023 +0800

    add ShooterSubtitleDataSouce

commit 61cc706
Author: kintan <[email protected]>
Date:   Sat May 6 20:29:03 2023 +0800

    优化字幕

commit 86bc6ea
Author: kintan <[email protected]>
Date:   Fri May 5 22:07:36 2023 +0800

    优化代码

commit 0aa40c3
Author: kintan <[email protected]>
Date:   Fri May 5 20:12:23 2023 +0800

    fix tvos

commit 95e43a5
Author: kintan <[email protected]>
Date:   Fri May 5 19:28:52 2023 +0800

    add any

commit c9dd67d
Author: kintan <[email protected]>
Date:   Thu May 4 19:00:58 2023 +0800

    support selectable subtitle

commit d58a932
Author: kintan <[email protected]>
Date:   Thu May 4 16:09:42 2023 +0800

    支持文字字幕选中

commit 06d5785
Author: kintan <[email protected]>
Date:   Thu May 4 16:09:15 2023 +0800

    拆分类

commit b6e172d
Author: kintan <[email protected]>
Date:   Wed May 3 21:27:28 2023 +0800

    fix #423

commit 2649831
Author: kintan <[email protected]>
Date:   Wed May 3 10:52:01 2023 +0800

    优化代码

commit 0609316
Author: kintan <[email protected]>
Date:   Tue May 2 22:21:58 2023 +0800

    解决不是非异步解码,锁没有释放的问题

commit 9941a5a
Author: kintan <[email protected]>
Date:   Mon May 1 21:03:29 2023 +0800

    fix 420 add metadata

commit f46675f
Merge: f89c3ff 4a1c0a5
Author: kingslay <[email protected]>
Date:   Mon May 1 17:22:31 2023 +0800

    Merge pull request #421 from birdmichael/develop

    添加Vtt支持

commit 4a1c0a5
Author: BirdMichael <[email protected]>
Date:   Mon May 1 17:08:08 2023 +0800

    添加Vtt支持

    字幕格式:
    WEBVTT

    00:00.430 --> 00:03.380
    简中封装 by Q66

    00:04.050 --> 00:05.950
    结果我去柜台那边

    00:05.980 --> 00:09.060
    -他说我下次会投胎为人类
    -真假? -那很厉害吧?

    00:09.090 --> 00:11.380
    因为要投胎为人应该没那么容易吧?

    00:11.410 --> 00:14.510
    -我就从来没有这个机会
    -原来哦 那很棒耶

    00:14.540 --> 00:16.270
    嗯…

    00:16.300 --> 00:19.910
    但我实在没心情就那样投胎转世

    00:19.940 --> 00:22.580
    -为什么 投胎为人很好啊
    -对啊

    00:22.610 --> 00:25.130
    而且你不是为了投胎为人
    才重来了好几次吗

    00:25.150 --> 00:26.350
    是没错啦

    00:26.380 --> 00:28.860
    既然还可以重来
    一定会想救你们三个的啊

    00:28.890 --> 00:30.670
    -你是为了我们三个吗
    -那当然啊

commit f89c3ff
Author: kintan <[email protected]>
Date:   Fri Apr 28 22:12:08 2023 +0800

    优化代码

commit 1335853
Author: kintan <[email protected]>
Date:   Fri Apr 28 21:58:16 2023 +0800

    优化代码

commit 994cf8a
Author: kintan <[email protected]>
Date:   Fri Apr 28 21:47:06 2023 +0800

    fix metalView

commit a550256
Author: kintan <[email protected]>
Date:   Fri Apr 28 21:27:26 2023 +0800

    fix #419

commit 92c2a3f
Author: kintan <[email protected]>
Date:   Fri Apr 21 22:59:36 2023 +0800

    fix #413 add bytesRead

commit f509585
Author: kintan <[email protected]>
Date:   Wed Apr 19 21:10:24 2023 +0800

    fix #411

commit 3456aa0
Author: kintan <[email protected]>
Date:   Sun Apr 16 17:23:14 2023 +0800

    fix #408 add canStartPictureInPictureAutomaticallyFromInline

commit 7cfd888
Author: kintan <[email protected]>
Date:   Sat Apr 15 22:28:32 2023 +0800

    add sei

commit 1aa4aaf
Author: kintan <[email protected]>
Date:   Sat Apr 15 21:04:41 2023 +0800

    support xcode 14.2

commit 7d75d92
Author: kintan <[email protected]>
Date:   Thu Apr 13 22:16:27 2023 +0800

    fix #406

commit c339f19
Author: kintan <[email protected]>
Date:   Wed Apr 12 19:07:34 2023 +0800

    优化图片字幕

commit 60e9eff
Author: kintan <[email protected]>
Date:   Sun Apr 9 18:00:59 2023 +0800

    优化reconnect

commit e108962
Author: kintan <[email protected]>
Date:   Sun Apr 9 16:28:25 2023 +0800

    fix #404

commit 03e8911
Author: kintan <[email protected]>
Date:   Wed Apr 5 13:32:29 2023 +0800

    update code

commit b92afd4
Author: kintan <[email protected]>
Date:   Sun Apr 2 17:14:49 2023 +0800

    fix crash

commit b2e768d
Author: kintan <[email protected]>
Date:   Sat Apr 1 17:37:54 2023 +0800

    优化代码

commit e7166d0
Author: kintan <[email protected]>
Date:   Sat Mar 25 17:20:16 2023 +0800

    优化 AudioRendererPlayer

commit 236b9d6
Author: kintan <[email protected]>
Date:   Sat Mar 25 12:29:39 2023 +0800

    add canStartPictureInPictureAutomaticallyFromInline

commit 356f7f0
Author: kintan <[email protected]>
Date:   Sat Mar 25 11:41:44 2023 +0800

    优化pip

commit 3b35798
Author: kintan <[email protected]>
Date:   Fri Mar 24 21:21:09 2023 +0800

    fix  #394

commit 440cab4
Author: kintan <[email protected]>
Date:   Sat Mar 11 21:46:29 2023 +0800

    fix #390

commit 7b4a608
Author: kintan <[email protected]>
Date:   Sat Mar 11 09:35:19 2023 +0800

    fix #157

commit c4f142f
Author: kintan <[email protected]>
Date:   Sat Mar 11 09:19:32 2023 +0800

    add seektime log

commit 2fca7a5
Author: kintan <[email protected]>
Date:   Fri Mar 10 18:54:24 2023 +0800

    fix Seeking through a saved .ts file

commit a941b17
Author: kintan <[email protected]>
Date:   Wed Mar 1 19:08:09 2023 +0800

    fix  #389

commit 04989e5
Author: kintan <[email protected]>
Date:   Sun Feb 26 23:06:59 2023 +0800

    fix #385

commit f90342f
Author: kintan <[email protected]>
Date:   Thu Feb 23 19:11:26 2023 +0800

    fix customizeDar fix #382

commit 2485346
Author: kintan <[email protected]>
Date:   Tue Feb 21 12:23:14 2023 +0800

    add isSeekImageSubtitle fix #321

commit 730cc50
Author: kintan <[email protected]>
Date:   Tue Feb 21 12:22:50 2023 +0800

    change TVOSVideoPlayerView to VideoPlayerView

commit b1d7ec9
Author: kintan <[email protected]>
Date:   Sun Feb 19 18:16:55 2023 +0800

    fix #355

commit ff80fa3
Author: kintan <[email protected]>
Date:   Sun Feb 19 17:14:56 2023 +0800

    add package resolved
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