{"id":26275710,"url":"https://github.com/hainayanda/odeum","last_synced_at":"2025-05-06T16:05:02.750Z","repository":{"id":45237488,"uuid":"332237561","full_name":"hainayanda/Odeum","owner":"hainayanda","description":"Odeum is a simple iOS Video player library with basic control","archived":false,"fork":false,"pushed_at":"2022-08-15T01:56:01.000Z","size":1152,"stargazers_count":5,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T12:57:58.442Z","etag":null,"topics":["apple","cocoapods","ios","library","player","swift","swiftpackagemanager","uikit","video","videoplayer"],"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/hainayanda.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":"2021-01-23T15:05:56.000Z","updated_at":"2023-07-24T12:10:36.000Z","dependencies_parsed_at":"2022-08-15T02:40:10.393Z","dependency_job_id":null,"html_url":"https://github.com/hainayanda/Odeum","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hainayanda%2FOdeum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hainayanda%2FOdeum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hainayanda%2FOdeum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hainayanda%2FOdeum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hainayanda","download_url":"https://codeload.github.com/hainayanda/Odeum/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252720308,"owners_count":21793737,"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":["apple","cocoapods","ios","library","player","swift","swiftpackagemanager","uikit","video","videoplayer"],"created_at":"2025-03-14T10:17:41.016Z","updated_at":"2025-05-06T16:05:02.702Z","avatar_url":"https://github.com/hainayanda.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Odeum\n\nOdeum is a simple iOS Video player library with basic control\n\n![build](https://github.com/hainayanda/Odeum/workflows/build/badge.svg)\n![test](https://github.com/hainayanda/Odeum/workflows/test/badge.svg)\n[![SwiftPM Compatible](https://img.shields.io/badge/SwiftPM-Compatible-brightgreen)](https://swift.org/package-manager/)\n[![Version](https://img.shields.io/cocoapods/v/Odeum.svg?style=flat)](https://cocoapods.org/pods/Odeum)\n[![License](https://img.shields.io/cocoapods/l/Odeum.svg?style=flat)](https://cocoapods.org/pods/Odeum)\n[![Platform](https://img.shields.io/cocoapods/p/Odeum.svg?style=flat)](https://cocoapods.org/pods/Odeum)\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"ScreenShot.png\"/\u003e\n\u003cp align=\"center\"\u003e\n  \n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Requirements\n\n- Swift 5.0 or higher\n- iOS 10.0 or higher\n\n## Installation\n\n### Cocoapods\n\nOdeum is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'Odeum'\n```\n\n### Swift Package Manager from XCode\n\n- Add it using XCode menu **File \u003e Swift Package \u003e Add Package Dependency**\n- Add **\u003chttps://github.com/hainayanda/Odeum.git\u003e** as Swift Package URL\n- Set rules at **version**, with **Up to Next Major** option and put **1.2.8** as its version\n- Click next and wait\n\n### Swift Package Manager from Package.swift\n\nAdd as your target dependency in **Package.swift**\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/hainayanda/Odeum.git\", .upToNextMajor(from: \"1.2.8\"))\n]\n```\n\nUse it in your target as `Odeum`\n\n```swift\n .target(\n    name: \"MyModule\",\n    dependencies: [\"Odeum\"]\n)\n```\n\n## Author\n\nNayanda Haberty, hainayanda@outlook.com\n\n## License\n\nOdeum is available under the MIT license. See the [LICENSE](LICENSE) file for more info.\n\n## Usage\n\nUsing Odeum is very easy. You could see the sample project or just read this documentation.\n\nSince odeum player is subclass of `UIView`. adding player is same like adding simple `UIView`:\n\n```swift\nvar odeumPlayer = OdeumPlayerView()\nview.addSubview(odeumPlayer)\n```\n\nIs up to you how you want it to be framed, using `NSLayoutConstraints` or by manually framing it.\n\nYou could also add it using storyboard or XIB. Just use `UIView` and set its `CustomClass` to be `OdeumPlayerView`.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"CustomView.png\"/\u003e\n\u003cp align=\"center\"\u003e\n\nTo play the player, just add URL:\n\n```swift\nodeumPlayer.play(url: myURL)\n```\n\nthere are methods to manipulate video playing in odeum:\n\n- `func set(url: URL)` to set url but not automatically play the video\n- `func play()` to play the video if video is ready to play\n- `func play(url: URL)` to set url and automatically play it if video is ready\n- `func pause()` to pause the video\n- `func set(mute: Bool)` to mute or unmute the video\n- `func forward(by second: TimeInterval) -\u003e Bool` to forward a video by given `TimeInterval`\n- `func replay(by second: TimeInterval) -\u003e Bool` to rewind a video by given `TimeInterval`\n- `func goFullScreen()` to go to full screen\n- `func dismissFullScreen()` to dismiss full screen\n- `func removeVideo()` to stop and remove video from video player\n\nAll those functions will run automatically on the player control hover buttons\n\n### Delegate\n\nYou could observe event and control tap behavior in the OdeumPlayerView by give them delegate:\n\n```swift\npublic protocol OdeumPlayerViewDelegate: class {\n    func odeumDidPlayVideo(_ player: OdeumPlayerView)\n    func odeumDidPauseVideo(_ player: OdeumPlayerView)\n    func odeumViewControllerToPresentFullScreen(_ player: OdeumPlayerView) -\u003e UIViewController\n    func odeumDidGoToFullScreen(_ player: OdeumPlayerView)\n    func odeumDidDismissFullScreen(_ player: OdeumPlayerView)\n    func odeumDidMuted(_ player: OdeumPlayerView)\n    func odeumDidUnmuted(_ player: OdeumPlayerView)\n    func odeum(_ player: OdeumPlayerView, forwardedBy interval: TimeInterval)\n    func odeum(_ player: OdeumPlayerView, rewindedBy interval: TimeInterval)\n    func odeumDidBuffering(_ player: OdeumPlayerView)\n    func odeumDidFinishedBuffering(_ player: OdeumPlayerView)\n    func odeum(_ player: OdeumPlayerView, progressingBy percent: Double)\n    func odeum(_ player: OdeumPlayerView, shouldShowOnTapWhen appearance: OdeumPlayerView.ControlAppearanceState) -\u003e Bool\n    func odeum(_ player: OdeumPlayerView, shouLdHideOnTapWhen appearance: OdeumPlayerView.ControlAppearanceState) -\u003e Bool\n}\n```\n\nAll the methods are optional\n\n### PlayerControl\n\nIf the user taps the video player, it will show `PlayerControlView` which will control how the video will be played in `OdeumPlayerView`. You could also change the icon of the `PlayerControlView`:\n\n```swift\nodeumPlayer.playerControl.set(icon: myIcon, for: ReplayStep.fiveSecond)\n```\n\nthe states are:\n\n```swift\npublic enum PlayState {\n    case played\n    case paused\n}\n\npublic enum AudioState {\n    case mute\n    case unmute\n}\n\npublic enum ReplayStep {\n    case fiveSecond\n    case tenSecond\n    case thirtySecond\n}\n\npublic enum ForwardStep {\n    case fiveSecond\n    case tenSecond\n    case thirtySecond\n}\n\npublic enum FullScreenState {\n    case fullScreen\n    case minimize\n}\n```\n\nTo change the replay step and audio state time interval, you could assign it directly on `playerControl`:\n\n```swift\nodeumPlayer.playerControl.forwardStep = .thirtySecond\nodeumPlayer.playerControl.replayStep = .thirtySecond\n```\n\n### Contribute\n\nYou know how, just clone and do pull request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhainayanda%2Fodeum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhainayanda%2Fodeum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhainayanda%2Fodeum/lists"}