https://github.com/phhai1710/videoquickseeking
Youtube-like double tap to forward/rewind animation with ripple effect.
https://github.com/phhai1710/videoquickseeking
forward ios rewind ripple ripple-effect swift video-controls youtube
Last synced: about 2 months ago
JSON representation
Youtube-like double tap to forward/rewind animation with ripple effect.
- Host: GitHub
- URL: https://github.com/phhai1710/videoquickseeking
- Owner: phhai1710
- License: mit
- Created: 2022-07-03T18:03:22.000Z (over 3 years ago)
- Default Branch: develop
- Last Pushed: 2024-09-22T18:23:03.000Z (about 1 year ago)
- Last Synced: 2025-08-16T20:02:43.226Z (about 2 months ago)
- Topics: forward, ios, rewind, ripple, ripple-effect, swift, video-controls, youtube
- Language: Swift
- Homepage:
- Size: 52.5 MB
- Stars: 9
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# VideoQuickSeeking
[](https://cocoapods.org/pods/VideoQuickSeeking)
[](https://cocoapods.org/pods/VideoQuickSeeking)
[](https://cocoapods.org/pods/VideoQuickSeeking)
Youtube-like double tap to forward/rewind animation with ripple effect.
Please feel free to make pull requests.
## ExampleTo run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
## Installation
VideoQuickSeeking is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod 'VideoQuickSeeking'
```
## Usage In Swift
``` Swift
let quickSeekingView = QuickSeekingView(seekingDuration: 10)
```
To achieve ripple effect, add QuickSeekingView onto the top of video player view. Handle double tap gesture of video player view and pass it to QuickSeekingView.
```Swift
let doubleTapGesture = UITapGestureRecognizer(target: self, action: #selector(doubleTap))
doubleTapGesture.numberOfTapsRequired = 2
.addGestureRecognizer(doubleTapGesture)@objc private func doubleTap(_ sender: UIGestureRecognizer) {
let point = sender.location(in: self.quickSeekingView)
// Pass touch point to QuickSeekingView here
}
```The following methods are available on QuickSeekingView.
### 1. setRippleStyle
Set the expected style of ripple effect
```Swift
func setRippleStyle(color: UIColor,
withRippleAlpha rippleAlpha: CGFloat,
withBackgroundAlpha backgroundAlpha: CGFloat)
```### 2. directionOfPoint
Get the direction(Forward/Rewind) of the current point
```Swift
func directionOfPoint(point: CGPoint) -> FRDirection?
```### 3. animate
Perform ripple effect at a specific point
```Swift
func animate(direction: FRDirection, at point: CGPoint,shouldResetSeekingCounter: Bool = false)
```
## AuthorHai Pham, phhai1710@gmail.com
## Inspired
This project reuse [RippleLayer](https://github.com/twho/material-design-widgets-lite-ios/blob/master/MaterialDesignWidgets/MaterialDesignWidgets/RippleLayer.swift) of [Twho](https://github.com/twho)## License
VideoQuickSeeking is available under the MIT license. See the LICENSE file for more info.