-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Amanda/ui features #30
base: pheonix
Are you sure you want to change the base?
Changes from 6 commits
925f3b8
9558056
07287bd
211aa44
559eea6
58e0dae
92ce5b3
b7c5931
8741444
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "[email protected]", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "[email protected]", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "[email protected]", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,25 +3,28 @@ import AVFoundation | |
|
||
private let streamURL = URL(string: "http://kdic.grinnell.edu/stream")! | ||
|
||
private(set) var isPlaying = false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be in the class, like on line 9. |
||
|
||
open class KDICPlayer { | ||
private static var player: AVPlayer = { | ||
let asset = AVURLAsset(url: streamURL) | ||
let playerItem = AVPlayerItem(asset: asset) | ||
let currentlyPlaying = isPlaying; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You never use this binding. |
||
return AVPlayer(playerItem: playerItem) | ||
}() | ||
|
||
open static var isPlaying = player.rate != 0 | ||
|
||
open class func play() { | ||
player.play() | ||
isPlaying = true | ||
} | ||
|
||
open class func pause() { | ||
player.pause() | ||
isPlaying = false | ||
} | ||
|
||
open class func toggle() { | ||
if isPlaying { | ||
if isPlaying == true { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Must we use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to have |
||
pause() | ||
} else { | ||
play() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Extraneous newline.