Giter Club home page Giter Club logo

Comments (15)

wertpoiu avatar wertpoiu commented on May 23, 2024

I have implemented seek with arrows but time stamps and progress bar dont update with seek

from ksplayer.

wertpoiu avatar wertpoiu commented on May 23, 2024

Plus it freezes ui sometime

from ksplayer.

kingslay avatar kingslay commented on May 23, 2024

You can check this function
panGestureAction

from ksplayer.

wertpoiu avatar wertpoiu commented on May 23, 2024

How to use it please provide code.

from ksplayer.

kingslay avatar kingslay commented on May 23, 2024
   @objc private func panGestureAction(_ pan: UIPanGestureRecognizer) {
        // 播放结束时,忽略手势,锁屏状态忽略手势
        guard !replayButton.isSelected, !isLock else { return }
        // 根据上次和本次移动的位置,算出一个速率的point
        let velocityPoint = pan.velocity(in: self)
        switch pan.state {
        case .began:
            // 使用绝对值来判断移动的方向
            if abs(velocityPoint.x) > abs(velocityPoint.y) {
                scrollDirection = .horizontal
            } else {
                scrollDirection = .vertical
            }
            panGestureBegan(location: pan.location(in: self), direction: scrollDirection)
        case .changed:
            panGestureChanged(velocity: velocityPoint, direction: scrollDirection)
        case .ended:
            panGestureEnded()
        default:
            break
        }
    }

open func panGestureChanged(velocity point: CGPoint, direction: KSPanDirection) {
        if direction == .horizontal {
            if !KSPlayerManager.enablePlaytimeGestures {
                return
            }
            isSliderSliding = true
            if totalTime > 0 {
                // 每次滑动需要叠加时间,通过一定的比例,使滑动一直处于统一水平
                tmpPanValue += panValue(velocity: point, direction: direction, currentTime: Float(toolBar.currentTime), totalTime: Float(totalTime))
                tmpPanValue = max(min(tmpPanValue, Float(totalTime)), 0)
                showSeekToView(second: Double(tmpPanValue), isAdd: point.x > 0)
            }
        }
    }

from ksplayer.

wertpoiu avatar wertpoiu commented on May 23, 2024

pan gesture will not work its right and left arrows only on old or universal remotes.

from ksplayer.

kingslay avatar kingslay commented on May 23, 2024

you can override pressesBegan for leftArrow and rightArrow to seek

from ksplayer.

wertpoiu avatar wertpoiu commented on May 23, 2024

you can override pressesBegan for leftArrow and rightArrow to seek

i did that your seek function has issue sometimes video goes black. and when i seek, slider and time stamps dont update with seek. it updates only after playing video.

from ksplayer.

wertpoiu avatar wertpoiu commented on May 23, 2024

Hi, i updated the code and seek issue has got more worse

from ksplayer.

kingslay avatar kingslay commented on May 23, 2024

you can update the demo and pull requests. then i will look the code and fixed it.

from ksplayer.

wertpoiu avatar wertpoiu commented on May 23, 2024

you can update the demo and pull requests. then i will look the code and fixed it.

ok thanks

from ksplayer.

wertpoiu avatar wertpoiu commented on May 23, 2024

Can you please update code in the pod to give this functionality by default? Set the velocity with three different speeds on pressing arrows. @kingslay

from ksplayer.

wertpoiu avatar wertpoiu commented on May 23, 2024

@kingslay Can you please update soon?

from ksplayer.

wertpoiu avatar wertpoiu commented on May 23, 2024

Can you please update?

from ksplayer.

kingslay avatar kingslay commented on May 23, 2024

i have not a old apple tv remotes. You can initiate a merge request.

from ksplayer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.