{"id":19942811,"url":"https://github.com/uakihir0/uipipview","last_synced_at":"2025-04-10T05:00:12.090Z","repository":{"id":39614312,"uuid":"437511137","full_name":"uakihir0/UIPiPView","owner":"uakihir0","description":"This library is a UIView that is capable of Picture-in-Picture (PiP) in iOS.","archived":false,"fork":false,"pushed_at":"2023-02-09T13:56:05.000Z","size":13308,"stargazers_count":227,"open_issues_count":6,"forks_count":34,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-03T01:11:09.646Z","etag":null,"topics":["ios","pip","swift","uikit"],"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/uakihir0.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-12T10:13:50.000Z","updated_at":"2025-03-28T03:43:09.000Z","dependencies_parsed_at":"2025-01-09T02:48:00.768Z","dependency_job_id":null,"html_url":"https://github.com/uakihir0/UIPiPView","commit_stats":{"total_commits":32,"total_committers":3,"mean_commits":"10.666666666666666","dds":0.15625,"last_synced_commit":"55994ac410ec29d81958f689b22eae0917445da9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uakihir0%2FUIPiPView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uakihir0%2FUIPiPView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uakihir0%2FUIPiPView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uakihir0%2FUIPiPView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uakihir0","download_url":"https://codeload.github.com/uakihir0/UIPiPView/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248161267,"owners_count":21057554,"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":["ios","pip","swift","uikit"],"created_at":"2024-11-13T00:14:17.382Z","updated_at":"2025-04-10T05:00:12.035Z","avatar_url":"https://github.com/uakihir0.png","language":"Swift","readme":"[\u003e\u003e 日本語](./Document/README.ja.md)\n\n# UIPiPView\n\n\u003c!--\n[![Version](https://img.shields.io/cocoapods/v/UIPiPView.svg?style=flat)](https://cocoapods.org/pods/UIPiPView)\n[![License](https://img.shields.io/cocoapods/l/UIPiPView.svg?style=flat)](https://cocoapods.org/pods/UIPiPView)\n[![Platform](https://img.shields.io/cocoapods/p/UIPiPView.svg?style=flat)](https://cocoapods.org/pods/UIPiPView)\n--\u003e\n\n\u003cimg src=\"./Document/image.gif\" width=200\u003e\n\n**This library is a UIView that is capable of Picture-in-Picture (PiP) in iOS.**\n\nUsing this library, information that is updated in real time (e.g. stock prices) can be displayed on the screen using PiP, even when the app is in the background. We look forward to seeing many ideas come to fruition using this library.\n\n## Requirements\n\nYou need to be running `iOS15` or higher. This library can be installed on `iOS12` or higher, but PiP cannot be executed without `iOS15` or higher.\n\nAlso, as a note for development, PiP will only work on **ACTUAL DEVICES**. Please note that PiP does not work with simulators. Also, this library depends on `AVKit` and `AVFoundation`.\n\nIf you want to include this library in your app, you need to enable `Audio, AirPlay and Picture in Picture` in `Background Modes`. For more information, see [Apple's page](https://developer.apple.com/documentation/avfoundation/media_playback_and_selection/creating_a_basic_video_player_ios_and_tvos/enabling_background_audio).\n\n## Installation\n\nUIPiPView can be installed using [CocoaPods](https://cocoapods.org). You can install it using You can install it by writing the following to your `Podfile` and running `$ pod install`.\n\n```ruby\npod 'UIPiPView', :git =\u003e 'https://github.com/uakihir0/UIPiPView/', :branch =\u003e 'main'\n```\n\nor can be installed using [SwiftPM](https://www.swift.org/package-manager/).\n\n## Example\n\nIt is always a good idea to check if your environment is ready to use `UIPiPView` before you start. You can do this with the following code.\n\n```swift\nuiPipView.isUIPiPViewSupported()\n```\n\n### Start\n\nSince `UIPiPView` inherits from `UIView`, it can be used in the same way as `UIView`. To run PiP, execute the following function. Run the following function to run PiP.\n\n```swift\nuiPipView.startPictureInPicture(withRefreshInterval: (0.1 / 60.0))\n```\n\nThe above function will refresh the PiP screen 60 times per second. The screen refresh is a relatively heavy process because the `UIView` is converted to a `CMSampleBuffer` via a `UIImage`. Therefore, if the `UIView` is complex, the update processing may not be able to keep up, or it may affect other processing. In that case, change the arguments in the above code to reduce the update frequency, or run PiP with the following code.\n\n```swift\nuiPipView.startPictureInPictureWithManualCallRender()\n```\n\nThe above function will not automatically refresh the screen except for the first screen refresh. If you want to update the screen, execute the following additional code.\n\n```swift\nuiPipView.render()\n```\n\nRunning the above function will render the state of the `UIPiPView` at the time the thread completes. By using this function, we can perform rendering at each screen update timing and keep the rendering cost to a minimum.\n\n### Exit\n\nTo exit PiP, execute the following code.\n\n```swift\nuiPipView.stopPictureInPicture()\n```\n\n## Author\n\nAkihiro Urushihara  \nMail: [a.urusihara@gmail.com](a.urusihara@gmail.com)  \nTwitter: [@uakihir0](https://twitter.com/uakihir0)\n\n## License\n\nUIPiPiPView is available under the MIT license. See the LICENSE file for more info.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuakihir0%2Fuipipview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuakihir0%2Fuipipview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuakihir0%2Fuipipview/lists"}