Latest 0.0.3
Homepage https://github.com/Yvent/Zanyer
License MIT
Platforms ios 9.0
Authors

A Singleton For AVPlayer

Include

Play in the background

Zanyer.shared.setSessionActive()

}

Event handling under open screen

play progress

Zanyer.shared.playProgressBlock = {[weak self] (progress) in

}

loaded progress

Zanyer.shared.loadedProgressBlock = {[weak self] (progress) in

}

state change

Zanyer.shared.onStateChanged = {[weak self] (newState) in

        switch newState {

         case .running:

         case .paused:

         case .finished:

         }
}

play

Zanyer.shared.playMusic(model: ZanyerModel)

pause

Zanyer.shared.pauseMusic()

continue

Zanyer.shared.continueMusic()

UI and event handling under lock screen

command center play

Zanyer.shared.commandCenterPlayBlock = { [weak self] in

}

command center next

Zanyer.shared.commandCenterNextBlock = { [weak self] in

}

command center prve

Zanyer.shared.commandCenterPrveBlock = { [weak self] in

}

The handling of unexpected states

audio interruption

Interrupt start, pause music.Interrupt end, continue music.

Zanyer has been implemented and can be modified if needed.

switch type {
     case .began:  
         self.pauseMusic()
     case .ended: 
         self.continueMusic()
}

audio route change

Unplug the headset and pause music.Insert the headset and continue music.

switch type {
     case .newDeviceAvailable: 
         self.continueMusic()
     case .oldDeviceUnavailable:
         self.pauseMusic()
}

Requirements

Zanyer is compatible with Swift 4.x.
All Apple platforms are supported:

  • iOS 9.0+

Install via Podfile

To integrate Repeat into your Xcode project using CocoaPods, specify it in your Podfile:


use_frameworks!

platform :ios, '9.0'

target 'Zanyer-Demo' do

pod 'Zanyer' ,'~> 0.0.3'

end

Latest podspec

{
    "name": "Zanyer",
    "version": "0.0.3",
    "summary": "A singleton of player",
    "description": "A singleton of player,Including the remote control center.",
    "homepage": "https://github.com/Yvent/Zanyer",
    "license": "MIT",
    "authors": {
        "Yvent": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Yvent/Zanyer.git",
        "tag": "0.0.3"
    },
    "source_files": "Zanyer/*",
    "platforms": {
        "ios": "9.0"
    }
}

Pin It on Pinterest

Share This