{"id":1570,"url":"https://github.com/piemonte/Player","last_synced_at":"2025-08-06T16:32:34.129Z","repository":{"id":23790724,"uuid":"27166370","full_name":"piemonte/Player","owner":"piemonte","description":"▶️ Play and stream media in Swift","archived":false,"fork":false,"pushed_at":"2022-08-24T08:19:22.000Z","size":11117,"stargazers_count":2080,"open_issues_count":20,"forks_count":334,"subscribers_count":63,"default_branch":"main","last_synced_at":"2024-12-01T05:35:24.570Z","etag":null,"topics":["avfoundation","ios","media","player","player-swift","stream","swift","tvos","video-player"],"latest_commit_sha":null,"homepage":"","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/piemonte.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":"2014-11-26T08:16:48.000Z","updated_at":"2024-11-15T18:40:48.000Z","dependencies_parsed_at":"2022-07-13T09:10:34.011Z","dependency_job_id":null,"html_url":"https://github.com/piemonte/Player","commit_stats":null,"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piemonte%2FPlayer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piemonte%2FPlayer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piemonte%2FPlayer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piemonte%2FPlayer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/piemonte","download_url":"https://codeload.github.com/piemonte/Player/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228923770,"owners_count":17992575,"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":["avfoundation","ios","media","player","player-swift","stream","swift","tvos","video-player"],"created_at":"2024-01-05T20:15:50.123Z","updated_at":"2024-12-09T16:31:24.748Z","avatar_url":"https://github.com/piemonte.png","language":"Swift","readme":"![Player](https://github.com/piemonte/Player/raw/master/Player.gif)\n\n## Player\n\n`Player` is a simple iOS video player library written in [Swift](https://developer.apple.com/swift/).\n\n[![Build Status](https://travis-ci.com/piemonte/Player.svg?branch=master)](https://travis-ci.com/piemonte/Player) [![Pod Version](https://img.shields.io/cocoapods/v/Player.svg?style=flat)](http://cocoadocs.org/docsets/Player/) [![Swift Version](https://img.shields.io/badge/language-swift%205.0-brightgreen.svg)](https://developer.apple.com/swift) [![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://github.com/piemonte/Player/blob/master/LICENSE)\n\n- Looking for an obj-c video player? Check out [PBJVideoPlayer (obj-c)](https://github.com/piemonte/PBJVideoPlayer).\n- Looking for a Swift camera library? Check out [Next Level](https://github.com/NextLevel/NextLevel).\n\nNeed a different version of Swift?\n* `5.0` - Target your Podfile to the latest release or master\n* `4.2` - Target your Podfile to the `swift4.2` branch\n* `4.0` - Target your Podfile to the `swift4.0` branch\n\n### Features\n\n- [x] plays local media or streams remote media over HTTP\n- [x] customizable UI and user interaction\n- [x] no size restrictions\n- [x] orientation change support\n- [x] simple API\n- [x] video frame snapshot support\n\n# Quick Start\n\n`Player` is available for installation using the Cocoa dependency manager [CocoaPods](http://cocoapods.org/).  Alternatively, you can simply copy the `Player.swift` file into your Xcode project.\n\n```ruby\n# CocoaPods\npod \"Player\", \"~\u003e 0.13.2\"\n\n# Carthage\ngithub \"piemonte/Player\" ~\u003e 0.13.2\n```\n\n## Usage\n\nThe sample project provides an example of how to integrate `Player`, otherwise you can follow these steps.\n\nAllocate and add the `Player` controller to your view hierarchy.\n\n``` Swift\n self.player = Player()\n self.player.playerDelegate = self\n self.player.playbackDelegate = self\n self.player.view.frame = self.view.bounds\n\n self.addChild(self.player)\n self.view.addSubview(self.player.view)\n self.player.didMove(toParent: self)\n```\n\nProvide the file path to the resource you would like to play locally or stream. Ensure you're including the file extension.\n\n``` Swift\nlet videoUrl: URL = // file or http url\nself.player.url = videoUrl\n```\n\nplay/pause\n\n``` Swift\n self.player.playFromBeginning()\n```\n\nAdjust the fill mode for the video, if needed.\n\n``` Swift\n self.player.fillMode = .resizeAspectFit\n```\n\nDisplay video playback progress, if needed.\n\n``` Swift\nextension ViewController: PlayerPlaybackDelegate {\n\n    public func playerPlaybackWillStartFromBeginning(_ player: Player) {\n    }\n\n    public func playerPlaybackDidEnd(_ player: Player) {\n    }\n\n    public func playerCurrentTimeDidChange(_ player: Player) {\n        let fraction = Double(player.currentTime) / Double(player.maximumDuration)\n        self._playbackViewController?.setProgress(progress: CGFloat(fraction), animated: true)\n    }\n\n    public func playerPlaybackWillLoop(_ player: Player) {\n        self. _playbackViewController?.reset()\n    }\n\n}\n```\n\n## Documentation\n\nYou can find [the docs here](http://piemonte.github.io/Player/). Documentation is generated with [jazzy](https://github.com/realm/jazzy) and hosted on [GitHub-Pages](https://pages.github.com).\n\n## Community\n\n- Need help? Use [Stack Overflow](http://stackoverflow.com/questions/tagged/player-swift) with the tag 'player-swift'.\n- Questions? Use [Stack Overflow](http://stackoverflow.com/questions/tagged/player-swift) with the tag 'player-swift'.\n- Found a bug? Open an [issue](https://github.com/piemonte/player/issues).\n- Feature idea? Open an [issue](https://github.com/piemonte/player/issues).\n- Want to contribute? Submit a [pull request](https://github.com/piemonte/player/pulls).\n\n## Resources\n\n* [Swift Evolution](https://github.com/apple/swift-evolution)\n* [AV Foundation Programming Guide](https://developer.apple.com/library/ios/documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/00_Introduction.html)\n* [Next Level](https://github.com/NextLevel/NextLevel/), rad media capture in Swift\n* [PBJVision](https://github.com/piemonte/PBJVision), iOS camera engine, features touch-to-record video, slow motion video, and photo capture\n* [PBJVideoPlayer](https://github.com/piemonte/PBJVideoPlayer), a simple iOS video player library, written in obj-c\n\n## License\n\nPlayer is available under the MIT license, see the [LICENSE](https://github.com/piemonte/player/blob/master/LICENSE) file for more information.\n","funding_links":[],"categories":["Media","Libs","Swift","HarmonyOS","Video Players \u0026 Playback Libraries","Video [🔝](#readme)","Video"],"sub_categories":["Video","Other free courses","Windows Manager","Mobile Players"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiemonte%2FPlayer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiemonte%2FPlayer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiemonte%2FPlayer/lists"}