Skip to content

Commit

Permalink
Update to version 1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Willowrod committed Jan 14, 2022
1 parent a7ef665 commit 1239004
Show file tree
Hide file tree
Showing 13 changed files with 99 additions and 116 deletions.
5 changes: 5 additions & 0 deletions PlayKitReadme.md
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,11 @@ PlayKit will atttempt to change bitrate to that value (or the closest one BELOW

All notable changes to this project will be documented in this section.

### 1.0.3
- Fixed crash due to optional safety
- Fixed Playkit deinitialise failure
- Updated player to stop playing before loading new media

### 1.0.1
- Play harvested content as VODs
- Minor design change to standard UI
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ Change Log:

All notable changes to this project will be documented in this section.

### 1.0.3 - PlayKit fixes

### 1.0.1 - PlayKit minor updates

### 1.0 - Release
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

public class AMGAnalyticsConfig {
public struct AMGAnalyticsConfig {
var analyticsService: AMGAnalyticsService = .DISABLED
var accountCode: String = ""
var userName: String? = nil
Expand All @@ -28,7 +28,7 @@ public class AMGAnalyticsConfig {
partnerID = amgAnalyticsPartnerID
}

internal func updateYouboraParameter(id: Int, value: String){
internal mutating func updateYouboraParameter(id: Int, value: String){

if let param = youboraParameters.firstIndex(where: {$0.id == id}), param < youboraParameters.count {
youboraParameters.remove(at: param)
Expand Down Expand Up @@ -72,7 +72,7 @@ public class AMGAnalyticsConfig {
if accountCodeObject.count == 0 {
print("Creating Youbora service with no account code")
}
let service = AMGAnalyticsConfig(youboraAccountCode: self.accountCodeObject)
var service = AMGAnalyticsConfig(youboraAccountCode: self.accountCodeObject)
service.userName = userNameObject
service.youboraParameters = youboraParametersObject
return service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import UIKit
class AMGPlayKitStandardControl: UIView, AMGControlDelegate {

var isPlaying = true
var player: AMGPlayerDelegate? = nil
weak var player: AMGPlayerDelegate? = nil
var playerView: UIView? = nil
let playPause = UIButton(type: UIButton.ButtonType.custom)
let forwardButton = UIButton(type: UIButton.ButtonType.custom)
Expand Down Expand Up @@ -586,5 +586,10 @@ class AMGPlayKitStandardControl: UIView, AMGControlDelegate {
mainView.isHidden = !shouldShow
bottomScrubView.isHidden = shouldShow
}

func removeStandardView(){
player = nil
playerView = nil
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ extension AMGPlayKit {
completion(false)
return
}
let session = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
let session = URLSession.shared
var urlRequest = URLRequest(url: validURL)
urlRequest.httpMethod = "POST"
let request = session.dataTask(with: urlRequest) {data, response, error in
Expand All @@ -28,6 +28,8 @@ extension AMGPlayKit {
completion(false)
}
request.resume()
} else {
completion(false)
}
}

Expand All @@ -37,7 +39,7 @@ extension AMGPlayKit {
completion(true)
return
}
let session = URLSession(configuration: .default, delegate: self, delegateQueue: nil)
let session = URLSession.shared
var urlRequest = URLRequest(url: validURL)
urlRequest.httpMethod = "POST"
let request = session.dataTask(with: urlRequest) {data, response, error in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ extension AMGPlayKit: AVPictureInPictureControllerDelegate {
@objc internal func enterBackground(){
DispatchQueue.main.asyncAfter(deadline: .now() + 0.15) {
if let pip = self.pictureInPictureController, pip.isPictureInPictureActive {
self.player.play()
self.player?.play()
}
}
}
Expand Down
Loading

0 comments on commit 1239004

Please sign in to comment.