{"id":1562,"url":"https://github.com/sahin/mobileplayer-ios","last_synced_at":"2025-05-15T03:07:32.360Z","repository":{"id":30853001,"uuid":"34410518","full_name":"sahin/mobileplayer-ios","owner":"sahin","description":":iphone: :movie_camera: A powerful and completely customizable media player for iOS","archived":false,"fork":false,"pushed_at":"2022-07-21T22:10:51.000Z","size":62529,"stargazers_count":3083,"open_issues_count":51,"forks_count":354,"subscribers_count":105,"default_branch":"develop","last_synced_at":"2025-05-07T03:03:25.632Z","etag":null,"topics":["ads","cocoapods","ios","mobile","mobile-player","player","swift","video","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sahin.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":"2015-04-22T19:15:10.000Z","updated_at":"2025-05-02T19:37:46.000Z","dependencies_parsed_at":"2022-07-28T05:18:55.905Z","dependency_job_id":null,"html_url":"https://github.com/sahin/mobileplayer-ios","commit_stats":null,"previous_names":["mobileplayer/mobileplayer-ios"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahin%2Fmobileplayer-ios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahin%2Fmobileplayer-ios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahin%2Fmobileplayer-ios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sahin%2Fmobileplayer-ios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sahin","download_url":"https://codeload.github.com/sahin/mobileplayer-ios/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253957994,"owners_count":21990542,"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":["ads","cocoapods","ios","mobile","mobile-player","player","swift","video","video-player"],"created_at":"2024-01-05T20:15:49.894Z","updated_at":"2025-05-15T03:07:27.345Z","avatar_url":"https://github.com/sahin.png","language":"Swift","funding_links":[],"categories":["Media","Libs","Swift","HarmonyOS","Media and Graphics","Video [🔝](#readme)"],"sub_categories":["Video","Windows Manager"],"readme":"![logo](http://i.imgur.com/W9QtXEp.png)\n\nMobilePlayer [![CocoaPods](https://img.shields.io/cocoapods/p/MobilePlayer.svg?style=flat)](https://cocoapods.org/pods/MobilePlayer)\n==================\n[![codebeat badge](https://codebeat.co/badges/d9492bce-7a4b-4221-b7e0-9b5abf6dda6a)](https://codebeat.co/projects/github-com-mobileplayer-mobileplayer-ios)\n[![CocoaPods](http://img.shields.io/cocoapods/v/MobilePlayer.svg?style=flat)](http://cocoapods.org/?q=MobilePlayer)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Dependencies](https://img.shields.io/badge/dependencies-none-brightgreen.svg)](https://github.com/mobileplayer/mobileplayer-ios)\n[![StackOverflow](https://img.shields.io/badge/StackOverflow-Ask%20a%20question!-blue.svg)](httpx://stackoverflow.com/questions/ask?tags=mobile+player+ios+swift+video+player)\n[![Join the chat at https://gitter.im/mobileplayer/mobileplayer-ios](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mobileplayer/mobileplayer-ios?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nA powerful and completely customizable media player for iOS.\n\nTable of Contents\n==================\n1. [Features](#features)\n2. [Installation](#installation)\n3. [Usage](#usage)\n4. [Customization](#customization)\n  - [Skinning](#skinning)\n  - [Showing overlays](#showing-overlays)\n  - [Showing timed overlays](#showing-timed-overlays)\n  - [Pre-roll](#pre-roll)\n  - [Pause overlay](#pause-overlay)\n  - [Post-roll](#post-roll)\n6. [Examples](#examples)\n7. [Documentation](#documentation)\n8. [License](#license)\n\nFeatures\n==================\n- Branding\n  - Flexible skinning. Add a watermark, add/remove/move/resize interface elements, change their appearances and much more.\n  - Easily set up A/B tests. You can manage multiple player skins and configurations. Player view controllers can load configuration data from a local JSON file or remote JSON data. You also have the option to initialize and pass configuration objects programmatically, which allows for greater flexibility.\n- Engagement\n  - Comes with a built-in share button.\n  - Standard sharing behavior can easily be modified.\n  - Show any view controller as pre-roll or post-roll content.\n  - Powerful overlay system. Add any view controller as an overlay to your video. Make them permanently visible, set them to appear in defined playback time intervals, or while playback is paused.\n- 100% documented.\n\n### Future plans\n- Well defined and extensive `NSNotification`s.\n- Volume button and volume slider elements.\n- Airplay support.\n- Plugin support.\n- Pre-bundled analytics plugins for various platforms.\n- VAST support.\n- Monetization.\n\nInstallation\n==================\n\n### [CocoaPods](https://github.com/CocoaPods/CocoaPods)\nAdd the following line in your `Podfile`.\n```\npod \"MobilePlayer\"\n```\n\n### [Carthage](https://github.com/Carthage/Carthage#installing-carthage)\nAdd the following line to your [Cartfile](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfile).\n```\ngithub \"mobileplayer/mobileplayer-ios\"\n```\n\nUsage\n==================\n```swift\nimport MobilePlayer\n\nlet playerVC = MobilePlayerViewController(contentURL: videoURL)\nplayerVC.title = \"Vanilla Player - \\(videoTitle)\"\nplayerVC.activityItems = [videoURL] // Check the documentation for more information.\npresentMoviePlayerViewControllerAnimated(playerVC)\n```\n![example-plain](http://i.imgur.com/J6QpSKb.gif)\n\nCustomization\n==================\n\n**Initialize using local configuration file**\n```swift\nlet bundle = NSBundle.mainBundle()\nlet config = MobilePlayerConfig(fileURL: bundle.URLForResource(\n  \"WatermarkedPlayer\",\n  withExtension: \"json\")!)\nlet playerVC = MobilePlayerViewController(\n  contentURL: videoURL,\n  config: config)\nplayerVC.title = \"Watermarked Player - \\(videoTitle)\"\nplayerVC.activityItems = [videoURL]\npresent(playerVC, animated: true, completion: nil)\n```\n\n**Initialize using remote configuration data**\n```swift\nguard let configURL = NSURL(string: \"https://goo.gl/c73ANK\") else { return }\nlet playerVC = MobilePlayerViewController(\n  contentURL: videoURL,\n  config: MobilePlayerConfig(fileURL: configURL))\nplayerVC.title = \"Watermarked Player - \\(videoTitle)\"\nplayerVC.activityItems = [videoURL]\npresent(playerVC, animated: true, completion: nil)\n```\n\n**Configuration data**\n```json\n{\n  \"watermark\": {\n    \"image\": \"MovielalaLogo\"\n  }\n}\n```\n\n**Without a configuration file URL**\n```swift\nlet playerVC = MobilePlayerViewController(\n  contentURL: videoURL,\n  config: MobilePlayerConfig(\n    dictionary: [\"watermark\": [\"image\": \"MovielalaLogo\"]]))\nplayerVC.title = \"Watermarked Player - \\(videoTitle)\"\nplayerVC.activityItems = [videoURL]\npresent(playerVC, animated: true, completion: nil)\n```\n\n**Result**\n![example-customization](http://i.imgur.com/tGodgQx.png)\n\n### Skinning\n```json\n{\n  \"watermark\": {\n    \"image\": \"MovielalaLogo\",\n    \"position\": \"topRight\"\n  },\n  \"topBar\": {\n    \"backgroundColor\": [\"#a60500b0\", \"#a60500a0\"],\n    \"elements\": [\n      {\n        \"type\": \"button\",\n        \"identifier\": \"close\"\n      },\n      {\n        \"type\": \"slider\",\n        \"identifier\": \"playback\",\n        \"trackHeight\": 6,\n        \"trackCornerRadius\": 3,\n        \"minimumTrackTintColor\": \"#eee\",\n        \"availableTrackTintColor\": \"#9e9b9a\",\n        \"maximumTrackTintColor\": \"#cccccc\",\n        \"thumbTintColor\": \"#f9f9f9\",\n        \"thumbBorderWidth\": 1,\n        \"thumbBorderColor\": \"#fff\",\n        \"marginRight\": 4\n      }\n    ]\n  },\n  \"bottomBar\": {\n    \"backgroundColor\": [\"#a60500a0\", \"#a60500b0\"],\n    \"elements\": [\n      {\n        \"type\": \"label\",\n        \"text\": \"Now Watching\",\n        \"font\": \"Baskerville\",\n        \"size\": 12,\n        \"marginLeft\": 8,\n        \"marginRight\": 8\n      },\n      {\n        \"type\": \"label\",\n        \"identifier\": \"title\",\n        \"size\": 14\n      },\n      {\n        \"type\": \"button\",\n        \"identifier\": \"action\"\n      },\n      {\n        \"type\": \"toggleButton\",\n        \"identifier\": \"play\"\n      }\n    ]\n  }\n}\n```\nFor all available `identifier`s, check the documentation or [here](https://github.com/mobileplayer/mobileplayer-ios/blob/master/MobilePlayer/Config/ElementConfig.swift#L51). Same `identifier` value shouldn't be used more than once in a single configuration.\n\n**Result**\n![example-skinning](http://i.imgur.com/YyiYJCc.png)\n\n**Example designs**\n![example-design-skinning](http://i.imgur.com/qNDrx9T.gif)\n\n### Showing overlays\n```swift\nlet playerVC = MobilePlayerViewController(contentURL: videoURL)\nplayerVC.title = videoTitle\nplayerVC.activityItems = [videoURL]\npresent(playerVC, animated: true, completion: nil)\nProductStore.getProduct(\"1\", success: { product in\n  guard let product = product else { return }\n  playerVC.showOverlayViewController(\n    BuyOverlayViewController(product: product))\n})\n```\n![example-overlay](http://i.imgur.com/wAtNYjE.png)\n\n### Showing timed overlays\n```swift\nlet playerVC = MobilePlayerViewController(contentURL: videoURL)\nplayerVC.title = videoTitle\nplayerVC.activityItems = [videoURL]\npresent(playerVC, animated: true, completion: nil)\nProductStore.getProductPlacementsForVideo(\n  videoID,\n  success: { productPlacements in\n    guard let productPlacements = productPlacements else { return }\n    for placement in productPlacements {\n      ProductStore.getProduct(placement.productID, success: { product in\n        guard let product = product else { return }\n        playerVC.showOverlayViewController(\n          BuyOverlayViewController(product: product),\n          startingAtTime: placement.startTime,\n          forDuration: placement.duration)\n      })\n    }\n})\n```\n![example-timed-overlays](http://i.imgur.com/FuaJB7O.gif)\n\n### Pre-roll\n```swift\nlet playerVC = MobilePlayerViewController(\n  contentURL: videoURL,\n  prerollViewController: PrerollOverlayViewController())\nplayerVC.title = videoTitle\nplayerVC.activityItems = [videoURL]\npresent(playerVC, animated: true, completion: nil)\n```\n![example-preroll](http://i.imgur.com/oBV0HCF.png)\n\n### Pause overlay\n```swift\nlet playerVC = MobilePlayerViewController(\n  contentURL: videoURL,\n  pauseOverlayViewController: PauseOverlayViewController())\nplayerVC.title = videoTitle\nplayerVC.activityItems = [videoURL]\npresent(playerVC, animated: true, completion: nil)\n```\n\n**Result**\n![example-pause-overlay](http://i.imgur.com/wfC9a7t.gif)\n\n**Example designs**\n![example-design-pause-overlay](http://i.imgur.com/ectKEwy.gif)\n\n### Post-roll\n```swift\nlet playerVC = MobilePlayerViewController(\n  contentURL: videoURL,\n  postrollViewController: PostrollOverlayViewController())\nplayerVC.title = videoTitle\nplayerVC.activityItems = [videoURL]\npresent(playerVC, animated: true, completion: nil)\n```\n\n**Result**\n![example-postroll](http://i.imgur.com/Hp8NEfg.png)\n\n**Example designs**\n![example-design-postroll](http://i.imgur.com/MRVxNAt.gif)\n\nExamples\n==================\nAfter cloning the repo, run the `MobilePlayerExamples` target to see examples for many use cases.\n![examples](http://i.imgur.com/ztOPUW6.gif)\n\nDocumentation\n==================\nThe entire documentation for the library can be found [here](https://htmlpreview.github.io/?https://github.com/movielala/mobileplayer-ios/blob/master/Documentation/index.html).\n\nLicense\n==================\nThe use of the MobilePlayer open source edition is governed by a [Creative Commons license](http://creativecommons.org/licenses/by-nc-sa/3.0/). You can use, modify, copy, and distribute this edition as long as it’s for non-commercial use, you provide attribution, and share under a similar license.\nhttp://mobileplayer.io/license/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsahin%2Fmobileplayer-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsahin%2Fmobileplayer-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsahin%2Fmobileplayer-ios/lists"}