{"id":1568,"url":"https://github.com/mhergon/MPMoviePlayerController-Subtitles","last_synced_at":"2025-08-02T04:32:06.143Z","repository":{"id":12300614,"uuid":"14931105","full_name":"mhergon/MPMoviePlayerController-Subtitles","owner":"mhergon","description":"Easy way to show SRT files on MPMoviePlayerController","archived":false,"fork":false,"pushed_at":"2017-04-11T21:09:43.000Z","size":21685,"stargazers_count":193,"open_issues_count":0,"forks_count":25,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-07-19T09:52:32.564Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mhergon.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":"2013-12-04T17:42:52.000Z","updated_at":"2025-02-28T12:07:27.000Z","dependencies_parsed_at":"2022-11-28T10:34:25.259Z","dependency_job_id":null,"html_url":"https://github.com/mhergon/MPMoviePlayerController-Subtitles","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/mhergon/MPMoviePlayerController-Subtitles","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhergon%2FMPMoviePlayerController-Subtitles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhergon%2FMPMoviePlayerController-Subtitles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhergon%2FMPMoviePlayerController-Subtitles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhergon%2FMPMoviePlayerController-Subtitles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mhergon","download_url":"https://codeload.github.com/mhergon/MPMoviePlayerController-Subtitles/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhergon%2FMPMoviePlayerController-Subtitles/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268334615,"owners_count":24233793,"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-08-02T02:00:12.353Z","response_time":74,"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":"2024-01-05T20:15:50.078Z","updated_at":"2025-08-02T04:32:05.066Z","avatar_url":"https://github.com/mhergon.png","language":"Swift","funding_links":[],"categories":["Media"],"sub_categories":["Video","Other free courses"],"readme":"\u003cp align=\"center\" \u003e\n\u003cimg src=\"https://raw.github.com/mhergon/MPMoviePlayerController-Subtitles/master/assets/logo.png\" alt=\"Logo\" title=\"Logo\" width=250\u003e\n\u003c/p\u003e\n\n![issues](https://img.shields.io/github/issues/mhergon/MPMoviePlayerController-Subtitles.svg)\n\u0026emsp;\n![stars](https://img.shields.io/github/stars/mhergon/MPMoviePlayerController-Subtitles.svg)\n\u0026emsp;\n![license](https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg)\n\n\nMPMoviePlayerController-Subtitles is a library to display subtitles on iOS. It's built as a Swift extension and it's very easy to integrate.\n\n## How To Get Started\n\n### Installation with CocoaPods\n\n```ruby\nplatform :ios, '8.0'\npod \"MPMoviePlayerController-Subtitles\"\n```\n\n### Manually installation\n\n[Download](https://github.com/mhergon/MPMoviePlayerController-Subtitles/raw/master/MPMoviePlayerController-Subtitles.swift) (right-click) and add to your project.\n\n### Requirements\n\n| Version | Language  | Minimum iOS Target  |\n|:--------------------:|:---------------------------:|:---------------------------:|\n|          2.2.x         |            Swift 3.x            |            iOS 8            |\n|          2.0.x         |            Swift 2.x            |            iOS 8            |\n|          1.x         |            Objective-C            |            iOS 6            |\n\n\n### Usage with player\n\n```swift\nimport MPMoviePlayerControllerSubtitles\n```\n\n```swift\n// Video file\nlet videoFile = Bundle.main.path(forResource: \"trailer_720p\", ofType: \"mov\")\n\n// Subtitle file\nlet subtitleFile = Bundle.main.path(forResource: \"trailer_720p\", ofType: \"srt\")\nlet subtitleURL = URL(fileURLWithPath: subtitleFile!)\n\n// Movie player\nlet moviePlayerView = MPMoviePlayerViewController(contentURL: URL(fileURLWithPath: videoFile!))\npresentMoviePlayerViewControllerAnimated(moviePlayerView)\n\n// Add subtitles\nmoviePlayerView?.moviePlayer.addSubtitles().open(file: subtitleURL)\nmoviePlayerView?.moviePlayer.addSubtitles().open(file: subtitleURL, encoding: String.Encoding.utf8)\n\n// Change text properties\nmoviePlayerView?.moviePlayer.subtitleLabel?.textColor = UIColor.red\n\n// Play\nmoviePlayerView?.moviePlayer.play()\n```\n\n#### Screenshot\n\u003cp align=\"center\" \u003e\n\u003cimg src=\"https://raw.github.com/mhergon/MPMoviePlayerController-Subtitles/master/assets/screenshot.png\" alt=\"Screenshoot\" title=\"Screenshoot\"\u003e\n\u003c/p\u003e\n\n### Usage without player\n\nFrom version 2.2 you can search text in the SubRip file or text without need play any file.\n\n```swift\nimport MPMoviePlayerControllerSubtitles\n```\n\n```swift\n// Subtitle file\nlet subtitleFile = Bundle.main.path(forResource: \"trailer_720p\", ofType: \"srt\")\nlet subtitleURL = URL(fileURLWithPath: subtitleFile!)\n\n// Subtitle parser\nlet parser = Subtitles(file: subtitleURL, encoding: .utf8)\n\n// Do something with result\nlet subtitles = parser.searchSubtitles(at: 2.0) // Search subtitle at 2.0 seconds\n```\n\n## Contact\n\n- [Linkedin][2]\n- [Twitter][3] (@mhergon)\n\n[2]: https://es.linkedin.com/in/marchervera\n[3]: http://twitter.com/mhergon \"Marc Hervera\"\n\n## License\n\nLicensed under Apache License v2.0.\n\u003cbr\u003e\nCopyright 2017 Marc Hervera.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhergon%2FMPMoviePlayerController-Subtitles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhergon%2FMPMoviePlayerController-Subtitles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhergon%2FMPMoviePlayerController-Subtitles/lists"}