{"id":32315179,"url":"https://github.com/testpress/iosplayersdk","last_synced_at":"2025-10-23T10:43:34.225Z","repository":{"id":171889814,"uuid":"647907923","full_name":"testpress/iOSPlayerSDK","owner":"testpress","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-07T12:09:39.000Z","size":460,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-23T10:43:27.058Z","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/testpress.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-05-31T19:34:21.000Z","updated_at":"2025-10-07T12:09:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"180140ab-e678-4a7d-90c9-46304ca22811","html_url":"https://github.com/testpress/iOSPlayerSDK","commit_stats":null,"previous_names":["testpress/iosplayersdk"],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/testpress/iOSPlayerSDK","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testpress%2FiOSPlayerSDK","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testpress%2FiOSPlayerSDK/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testpress%2FiOSPlayerSDK/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testpress%2FiOSPlayerSDK/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/testpress","download_url":"https://codeload.github.com/testpress/iOSPlayerSDK/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testpress%2FiOSPlayerSDK/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280606604,"owners_count":26359387,"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","status":"online","status_checked_at":"2025-10-23T02:00:06.710Z","response_time":142,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-10-23T10:43:32.887Z","updated_at":"2025-10-23T10:43:34.220Z","avatar_url":"https://github.com/testpress.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Swift](https://img.shields.io/badge/Swift-5.5_5.6_5.7_5.8-orange)](https://img.shields.io/badge/Swift-5.5_5.6_5.7_5.8-Orange)\n[![Platforms](https://img.shields.io/badge/Platforms-iOS-green)](https://img.shields.io/badge/Platforms-iOS-Green)\n[![Swift Package Manager](https://img.shields.io/badge/Swift_Package_Manager-compatible-orange)](https://img.shields.io/badge/Swift_Package_Manager-compatible-orange)\n\n# Getting Started\n\n  TPStreamsSDK is a versatile iOS native SDK with support for both DRM (FairPlay) and non-DRM content.\n\n- [Requirements](#requirements)\n- [Integration using Swift Package Manager (SPM)](#integration-using-swift-package-manager-(spm))\n- [Intializing TPStreamsSDK](#initializing-tpstreamssdk)\n- [Playing a Video with TPStreamsSDK](#playing-a-video-with-tpstreamsSDK)\n    - [SwiftUI Integration](#SwiftUI-Integration)\n    - [UIKit Integration](#UIKit-Integration)\n- [Sample iOS app](https://github.com/testpress/sample-iOS-app)\n\n  \n### Requirements\n\nBefore integrating TPStreamsSDK into your iOS application, ensure that your project meets the following requirement:\n\n- Minimum Deployment Version: iOS 14 or later\n- Swift: Version 5.5 or later\n\n\n\n### Integration using Swift Package Manager (SPM)\n\nTo add TPStreamsSDK to your Xcode project using Swift Package Manager, follow these steps:\n\n- Select File \u003e Add Packages in Xcode.\n- In the search bar, enter the following URL: `https://github.com/testpress/iOSPlayerSDK`.\n- Select 'iOSPlayerSDK' from the search results. Click Add package button.\n\n\nOnce the package is added, you can start using TPStreamsSDK in your iOS application.\n\n\n\n### Initializing TPStreamsSDK\n\nIn the `application(_:didFinishLaunchingWithOptions:)` method in your AppDelegate, call `TPStreamsSDK.initialize(withOrgCode:)` to initialize the SDK with your organization code.\n\n \n``` swift\n\nclass AppDelegate: UIResponder, UIApplicationDelegate {\n    func application(_ application: UIApplication,didFinishLaunchingWithOptions launchOptions [UIApplicationLaunchOptionsKey: Any]?) -\u003e Bool {\n        TPStreamsSDK.initialize(withOrgCode: \"YOUR_ORGANIZATION_CODE\")\n        return true\n    }\n}\n\n```\n\n\u003e Please note that the above code assumes you are using SwiftUI for your application. If you are using a different app architecture, you may need to adapt the integration steps accordingly.\n\n\n\n### Playing a Video with TPStreamsSDK\n\n#### SwiftUI Integration\n1. Instantiate a TPAVPlayer by providing the appropriate assetID and accessToken.\n2. Embed the TPStreamPlayerView in your SwiftUI view.\n\n``` swift\n\nstruct ContentView: View {\n\tlet player = TPAVPlayer(assetID: \"YOUR_ASSET_ID\", accessToken: \"YOUR_ACCESS_TOKEN\")\n\n\tvar body: some View {\n\t\tVStack {\n\t\t\tTPStreamPlayerView(player: player)\n\t\t\t\t.frame(height: 240)\n\t\t\tSpacer()\n\t\t}\n\t}\n}\n\n```\n\n  \n\n#### UIKit Integration\n\n1. Instantiate a TPAVPlayer with the relevant assetID and accessToken.\n2. Create a TPStreamPlayerViewController and assign the previously created TPAVPlayer to the player attribute.\n3. Add the TPStreamPlayerViewController.view to the view hierarchy. This will display the video player within the specified playerContainer view.\n\n``` swift\nclass ViewController: UIViewController {\n    @IBOutlet weak var playerContainer: UIView!\n\n    var playerViewController: TPStreamPlayerViewController?\n    var player: TPAVPlayer?\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        self.setupPlayerView()\n        player?.play()\n    }\n\n    func setupPlayerView(){\n        player = TPAVPlayer(assetID: \"YOUR_ASSET_ID\", accessToken: \"YOUR_ACCESS_TOKEN\")\n        playerViewController = TPStreamPlayerViewController()\n        playerViewController?.player = player\n\n        addChild(playerViewController!)\n        playerContainer.addSubview(playerViewController!.view)\n        playerViewController!.view.frame = playerContainer.bounds\n    }\n}\n```\n  \n \n\u003e TPAVPlayer is a wrapper class of AVPlayer that provides built-in support for playing our videos without requiring\nadditional effort. It also supports FairPlay streaming for DRM-protected content.\n\n\u003e Since TPAVPlayer is a wrapper class of AVPlayer, you can also use the TPAVPlayer with native iOS player to play Streams\nVideos.  \n\n\n\nFor a practical implementation and usage of TPStreamsSDK, refer to our [Sample iOS App](https://github.com/testpress/sample-iOS-app).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestpress%2Fiosplayersdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftestpress%2Fiosplayersdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestpress%2Fiosplayersdk/lists"}