Latest 0.7.5
Homepage https://github.com/iOSWizards/AwesomeMedia
License MIT
Platforms ios 8.0
Authors

Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • iOS 8 +
  • Swift 4

Installation

AwesomeMedia is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "AwesomeMedia", git: 'https://github.com/iOSWizards/AwesomeMedia.git', tag: '0.7.5'

Usage

  1. Create a var extending AwesomeMediaView. Or extend a UIView component from the storyboard.

    var mediaView: AwesomeMediaView!
  2. Setup media to play.

    mediaView.setup(mediaPath: "http://overmind2.mindvalleyacademy.com/api/v1/assets/267bb3c6-d042-40ea-b1bd-9c9325c413eb.m3u8")
  3. Assign player layer to self (in case playing video).

    mediaView.addPlayerLayer()
  4. Setup delegate.
    
    AwesomeMedia.shared.playerDelegate = self

extension MediaViewController: AwesomeMediaPlayerDelegate {
public func didChangeSpeed(to: Float, mediaType: AMMediaType) {
print("MediaViewController didChangeSpeed((to))")
}

public func didChangeSlider(to: Float, mediaType: AMMediaType) {
    print("MediaViewController didChangeSlider((to))")
}

public func didStopPlaying(mediaType: AMMediaType) {
    print("MediaViewController didStopPlaying")
}

public func didStartPlaying(mediaType: AMMediaType) {
    print("MediaViewController didStartPlaying")
}

public func didPausePlaying(mediaType: AMMediaType) {
    print("MediaViewController didPausePlaying")
}

public func didFinishPlaying(mediaType: AMMediaType) {
    print("FullscreenMediaViewController didFinishPlaying")
}

public func didFailPlaying(mediaType: AMMediaType) {
    print("FullscreenMediaViewController didFailPlaying")
}

}


5. Setup orientation listener.
```swift
AwesomeMedia.shared.addOrientationObserverGoingLandscape(observer: self, selector: #selector(MediaViewController.goToLandscapeController))

func goToLandscapeController() {
    performSegue(withIdentifier: "presentFullScreenSegue", sender: self)
}
  1. Print Logs.
    AwesomeMedia.showLogs = true

License

AwesomeMedia is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "AwesomeMedia",
    "version": "0.7.5",
    "summary": "Play Sounds and Videos with AvPlayer.",
    "description": "Play Media from any app using this library.",
    "homepage": "https://github.com/iOSWizards/AwesomeMedia",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Evandro Harrison Hoffmann, Leonardo Kaminski Ferreira": "[email protected], [email protected]"
    },
    "source": {
        "git": "https://github.com/iOSWizards/AwesomeMedia.git",
        "tag": "0.7.5"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "AwesomeMedia/Classes/**/*.{swift}",
    "resource_bundles": {
        "AwesomeMedia": [
            "AwesomeMedia/Classes/**/*.{storyboard,xib,xcassets,json,imageset,png}"
        ]
    },
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This