{"id":29038047,"url":"https://github.com/teamsolutionanalysts/sa-plug-avplayer","last_synced_at":"2025-06-26T13:07:07.979Z","repository":{"id":62453258,"uuid":"188030492","full_name":"teamSolutionAnalysts/sa-plug-avplayer","owner":"teamSolutionAnalysts","description":null,"archived":false,"fork":false,"pushed_at":"2020-01-22T05:51:38.000Z","size":24527,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-04T16:19:46.786Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/teamSolutionAnalysts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-22T12:06:11.000Z","updated_at":"2020-01-22T05:51:40.000Z","dependencies_parsed_at":"2022-11-01T22:46:43.927Z","dependency_job_id":null,"html_url":"https://github.com/teamSolutionAnalysts/sa-plug-avplayer","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/teamSolutionAnalysts/sa-plug-avplayer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teamSolutionAnalysts%2Fsa-plug-avplayer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teamSolutionAnalysts%2Fsa-plug-avplayer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teamSolutionAnalysts%2Fsa-plug-avplayer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teamSolutionAnalysts%2Fsa-plug-avplayer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teamSolutionAnalysts","download_url":"https://codeload.github.com/teamSolutionAnalysts/sa-plug-avplayer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teamSolutionAnalysts%2Fsa-plug-avplayer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262072811,"owners_count":23254320,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-26T13:07:06.095Z","updated_at":"2025-06-26T13:07:07.970Z","avatar_url":"https://github.com/teamSolutionAnalysts.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SAPlugAVPlayer\n\nSimple and featured video player with full of customisation possibility, full control over AVPlayer. Adjust as you need in terms of design and feature.\n## Getting Started\nHere we have a simple plug and play module that a developer can use to integrate for video playing in swift 4.2. PlugAVPlayer lets you create your own UI and add images for buttons like play and fullscreen.\n\n## Features\n\n* Supports playing local videos and url streming.\n* Url with extension and embed video url supported (No control for embedded video).\n* Supports only Youtube embed URLs.\n* Supports fullscreen.\n* Slider design customization available.\n* FastForward and Backward support.\n* Next and Previous video callback.\n* Change player rate.\n* PlayerEventDelegate Delegate method control Next previous and reply, replace video with next or previous pan gesture delegate method which helps you manage your animation of video view.\n* Supports Save Video locally.\n* Supports custom player view.\n* Memory controll.\n\n### Preview\n\n![alt text](https://github.com/teamSolutionAnalysts/sa-plug-avplayer/blob/master/SAVideoPlayer/Simulator%20Screen%20Shot%20-%20iPhone%206%20-%202019-05-23%20at%2017.37.56.png)\n\n### Prerequisites\n\nSwift 4.2\n\niOS 10*\n\nXcode 10\n\n## Installing\n\nYou want to add pod 'SAPlugAVPlayer', '~\u003e 0.3.2' similar to the following to your Podfile\n```\ntarget 'MyApp' do\n\n  pod 'SAPlugAVPlayer', '~\u003e 0.3.2'\n  \nend\n```\nThen run a pod install inside your terminal, or from CocoaPods.app.\n\n## Carthage\n\nCarthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nYou can install Carthage with Homebrew using the following command:\n```\n$ brew update\n$ brew install carthage\n```\nTo integrate SAPlugAVPlayer into your Xcode project using Carthage, specify it in your Cartfile:\n\n\tgithub \"teamSolutionAnalysts/sa-plug-avplayer\" == 0.3.3\n\t\nRun carthage update to build the framework and drag the built SAPlugAVPlayer.framework into your Xcode project.\n\n## Manually\n\nIf you prefer not to use any of the aforementioned dependency managers, you can integrate SAPlugAVPlayer into your project manually. Just copy the source folder in your project directory from [Source](https://github.com/teamSolutionAnalysts/sa-plug-avplayer/tree/master/SAVideoPlayer)\n\n## Steps to add player\n### Assign ViewVideo class\n\n![alt text](https://github.com/teamSolutionAnalysts/sa-plug-avplayer/blob/master/SAVideoPlayer/AssignViewVideo.png)\n\n### Note for embed urls :\nIf you are planing to play only youtube embedded urls. Do not take VideoController view. You can play embedded url with ViewVideo only.\n\n```swift\nimport SAPlugAVPlayer\nimport AVFoundation\n\noverride func viewDidLoad() {\n    super.viewDidLoad()\n    setUpPlayerWithURlStreaming()\n}\n\nfunc setUpPlayerWithURlStreaming()\n{\n    self.viewVideo.configure(url: self.url, ControllView: nil)\n    self.viewVideo.delegate = self\n }\n```\n\n### Assign VideoController class to controller view\n\n![alt text](https://github.com/teamSolutionAnalysts/sa-plug-avplayer/blob/master/SAVideoPlayer/SetVideoController.png)\n\nDrag and drop IBOutlets from UI\n\n```swift \nclass ViewController : UIViewController{\n   \n    @IBOutlet weak var viewVideo: ViewVideo!\n    @IBOutlet weak var videoController: VideoController!\n    \n}\n```\n\n### Add and select images for buttons, play, pause, fullscreen, exitFullscreen, next and previous from Attribute Inspector as shown below\n![alt text](https://github.com/teamSolutionAnalysts/sa-plug-avplayer/blob/master/SAVideoPlayer/Set%20Images%20for%20controller.png)\n\n### To Play video from url streaming\n\n```swift\noverride func viewDidLoad() {\n    super.viewDidLoad()\n    setUpPlayerWithURlStreaming()\n}\n\nfunc setUpPlayerWithURlStreaming()\n{\n    self.viewVideo.configure(url: self.url, ControllView: self.videoController)\n    self.viewVideo.delegate = self\n    self.viewVideo.play()\n }\n```\n\n### To Play video from local path with extension\n```swift\noverride func viewDidLoad() {\n    super.viewDidLoad()\n    setUpPlayerWithLocal()\n}\n\nfunc setUpPlayerWithLocal()\n{\n    viewVideo.configure(ControllView: self.videoController,localPath:\"localpath\",fileextension : \"mp4\")\n    viewVideo.delegate = self\n    viewVideo.play()\n }\n```\n\n### Add PlayerEventDelegate\n\n```swift \n// MARK: - Player Delegate Methods\nextension ViewController : PlayerEventDelegate\n{\n    func SAAVPlayer(minimizevideoScreen: Bool) {\n      \n    }\n    \n    func SAAVPlayer(panGesture didTriggerd: UIPanGestureRecognizer?) {\n        \n    }\n    \n    func SAAVPlayer(didEndPlaying: AVPlayer?) {\n        //Play your next video\n\t//Replace your local video with next one\n        self.viewVideo.replacelocalVideo(path: \"Your next video path\", videoextension: \"mp4\")\n\t\n\tOR\n\t\n\t//Replace your streaming url with next one\n\tself.viewVideo.replaceVideo(videourl: \"url\")\n\t\n    }\n    \n    func SAAVPlayer(didTap overLay: AVPlayer?) {\n    }\n    \n    func SAAVPlayer(willExpand player: AVPlayer?) {\n       \n    }\n    \n    func SAAVPlayer(didTaptoNextvideo: AVPlayer?) {\n\t//Replace your local video with next one\n        self.viewVideo.replacelocalVideo(path: \"Your next video path\", videoextension: \"mp4\")\n\t\n\tOR\n\t\n\t//Replace your streaming url with next one\n\tself.viewVideo.replaceVideo(videourl: \"url\")\n    }\n    \n    func SAAVPlayer(didTaptoPreviousvideo: AVPlayer?) {\n        //Replace your video with previous one\n        self.viewVideo.replacelocalVideo(path: \"Your previous video\", videoextension: \"mp4\")\n\t\n\tOR\n\t\n\t//Replace your streaming url with next one\n\tself.viewVideo.replaceVideo(videourl: \"url\")\n    }\n    \n    func SAAVPlayer(panGesture sender: UIGestureRecognizer?) {\n        guard let sender = sender else{\n            return\n        }\n        let touchPoint = sender.location(in: self.viewVideo?.window)\n        if sender.state == UIGestureRecognizer.State.began {\n            initialTouchPoint = touchPoint\n        } else if sender.state == UIGestureRecognizer.State.changed {\n            if (touchPoint.x - initialTouchPoint.x) \u003e 10\n            {\n                self.viewVideo.fastForwardPlayer()\n            }\n            else if (initialTouchPoint.x - touchPoint.x) \u003e 10\n            {\n                self.viewVideo.fastBackward()\n            }\n        }\n    }\n}\n\n```\n\n## Optional configuration\n\n```swift\n\tself.viewVideo.saveVideoLocally = false\n        self.viewVideo.currentVideoID = self.videoID // to manage video by id\n        \n        //Change slider configuration (optional)\n        self.videoController.slider.baseColor  = // UIColor\n        self.videoController.slider.bufferColor = // UIColor\n        self.videoController.slider.progressColor = // UIColor\n        self.videoController.slider.borderWidth = // CGFloat\n        self.videoController.slider.roundedSlider = // Bool\n```\n\n### Player Rate \n\n```swift \n\tself.viewVideo.changePlayerRate(rate: rate)\n```\nThere is a method which lets you change the player\n\n### Built With\n\n* AVKit Framework\n* URLSession is used\n\n## Authors\nSolution Analyst\n\n## Reference:\nThe slider is used from raxcat/BufferSlider, git\n\n## License\n\nMIT License\n\nCopyright (c) 2019 Solution Analysts Pvt. Ltd.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteamsolutionanalysts%2Fsa-plug-avplayer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteamsolutionanalysts%2Fsa-plug-avplayer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteamsolutionanalysts%2Fsa-plug-avplayer/lists"}