<commit_before>import UIKit

public class QuickSeekPlugin: UICorePlugin {
    
    var doubleTapGesture: UITapGestureRecognizer!

    open class override var name: String {
        return "QuickSeekPlugin"
    }
    
    private var activePlayback: Playback? {
        return core?.activePlayback
    }
    
    private var animatonHandler: QuickSeekAnimation?
    
    required init(context: UIObject) {
        super.init(context: context)
        animatonHandler = QuickSeekAnimation(core)
    }
    
    override public func bindEvents() {
        bindCoreEvents()
    }
    
    private func bindCoreEvents() {
        guard let core = core else { return }
        listenTo(core, eventName: Event.didShowModal.rawValue) { [weak self] _ in self?.removeGesture() }
        listenTo(core, eventName: Event.didHideModal.rawValue) { [weak self] _ in self?.addGesture() }
    }
    
    func removeGesture() {
        NSException(name: NSExceptionName(rawValue: "MissingPluginImplementation"), reason: "QuickSeekPlugin should implement removeGesture method", userInfo: nil).raise()
    }
    
    func addGesture() {
        NSException(name: NSExceptionName(rawValue: "MissingPluginImplementation"), reason: "QuickSeekPlugin should implement addGesture method", userInfo: nil).raise()
    }
    
    override public func render() {
        addGesture()
    }
    
    func shouldSeek(point: CGPoint) -> Bool {
        return true
    }

    @objc func quickSeek(xPosition: CGFloat) {
        guard let activePlayback = core?.activePlayback,
            let container = core?.activeContainer,
            let coreViewWidth = core?.view.frame.width else { return }
        
        container.trigger(InternalEvent.didTapQuickSeek.rawValue)
        let didTapLeftSide = xPosition < coreViewWidth / 2
        if didTapLeftSide {
            seekBackward(activePlayback)
        } else {
            seekForward(activePlayback)
        }
    }
    
    private func seekBackward(_ playback: Playback) {
        guard playback.playbackType == .vod || playback.isDvrAvailable else { return }
        impactFeedback()
        playback.seek(playback.position - 10)
        guard playback.position - 10 > 0.0 else { return }
        animatonHandler?.animateBackward()
        core?.trigger(.didDoubleTouchMediaControl, userInfo: ["position": "left"])
    }
    
    private func seekForward(_ playback: Playback) {
        guard playback.playbackType == .vod || playback.isDvrAvailable && playback.isDvrInUse else { return }
        impactFeedback()
        playback.seek(playback.position + 10)
        guard playback.position + 10 < playback.duration else { return }
        animatonHandler?.animateForward()
        core?.trigger(.didDoubleTouchMediaControl, userInfo: ["position": "right"])
    }
    
    private func impactFeedback() {
        UIImpactFeedbackGenerator().impactOccurred()
    }
}
<commit_msg>feat: triggering didDoubleTouchMediaControl event on container<commit_after>import UIKit

public class QuickSeekPlugin: UICorePlugin {
    
    var doubleTapGesture: UITapGestureRecognizer!

    open class override var name: String {
        return "QuickSeekPlugin"
    }
    
    private var activePlayback: Playback? {
        return core?.activePlayback
    }
    
    private var animatonHandler: QuickSeekAnimation?
    
    required init(context: UIObject) {
        super.init(context: context)
        animatonHandler = QuickSeekAnimation(core)
    }
    
    override public func bindEvents() {
        bindCoreEvents()
    }
    
    private func bindCoreEvents() {
        guard let core = core else { return }
        listenTo(core, eventName: Event.didShowModal.rawValue) { [weak self] _ in self?.removeGesture() }
        listenTo(core, eventName: Event.didHideModal.rawValue) { [weak self] _ in self?.addGesture() }
    }
    
    func removeGesture() {
        NSException(name: NSExceptionName(rawValue: "MissingPluginImplementation"), reason: "QuickSeekPlugin should implement removeGesture method", userInfo: nil).raise()
    }
    
    func addGesture() {
        NSException(name: NSExceptionName(rawValue: "MissingPluginImplementation"), reason: "QuickSeekPlugin should implement addGesture method", userInfo: nil).raise()
    }
    
    override public func render() {
        addGesture()
    }
    
    func shouldSeek(point: CGPoint) -> Bool {
        return true
    }

    @objc func quickSeek(xPosition: CGFloat) {
        guard let activePlayback = core?.activePlayback,
            let container = core?.activeContainer,
            let coreViewWidth = core?.view.frame.width else { return }
        
        container.trigger(InternalEvent.didTapQuickSeek.rawValue)
        let didTapLeftSide = xPosition < coreViewWidth / 2
        if didTapLeftSide {
            seekBackward(activePlayback)
        } else {
            seekForward(activePlayback)
        }
    }
    
    private func seekBackward(_ playback: Playback) {
        guard playback.playbackType == .vod || playback.isDvrAvailable else { return }
        impactFeedback()
        playback.seek(playback.position - 10)
        guard playback.position - 10 > 0.0 else { return }
        animatonHandler?.animateBackward()
        core?.activeContainer?.trigger(.didDoubleTouchMediaControl, userInfo: ["position": "left"])
    }
    
    private func seekForward(_ playback: Playback) {
        guard playback.playbackType == .vod || playback.isDvrAvailable && playback.isDvrInUse else { return }
        impactFeedback()
        playback.seek(playback.position + 10)
        guard playback.position + 10 < playback.duration else { return }
        animatonHandler?.animateForward()
        core?.activeContainer?.trigger(.didDoubleTouchMediaControl, userInfo: ["position": "right"])
    }
    
    private func impactFeedback() {
        UIImpactFeedbackGenerator().impactOccurred()
    }
}

{'fraction_non_alphanumeric': 0.09180383505854403, 'fraction_numerical': 0.003733242830476837, 'mean_word_length': 2.7589285714285716, 'pattern_counts': {'":': 4, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4439543', 'n_tokens_mistral': 1692, 'n_tokens_neox': 1612, 'n_words': 367}