- Added the LiveTv Moving View. Converted the timer into animation for the moving view. - Made a Enum with custom functions to handle the time. - Added logic to handle the dark grass for night time - Rescaled the home grass so dark grass and light grass has identical dimensions - Handled the night mode with white text for clear text
39 lines
929 B
Swift
39 lines
929 B
Swift
//
|
|
// AuthFuncStartupSoundHandling.swift
|
|
// WOKA
|
|
//
|
|
// Created by MacBook Pro on 21/05/24.
|
|
//
|
|
|
|
import UIKit
|
|
import AVFoundation
|
|
|
|
extension AuthFunc{
|
|
// MARK: - Handle The Sound Globally
|
|
|
|
func playStartUpsound(){
|
|
guard let path = Bundle.main.path(forResource: K.StaticFilesString.onBoardMainSound, ofType:"m4a") else {
|
|
return }
|
|
let url = URL(fileURLWithPath: path)
|
|
|
|
let playerItem = AVPlayerItem(url: url)
|
|
|
|
// Initialize AVQueuePlayer with the player item
|
|
player = AVQueuePlayer(items: [playerItem])
|
|
|
|
// Create AVPlayerLooper
|
|
playerLooper = AVPlayerLooper(player: player!, templateItem: playerItem)
|
|
player?.play()
|
|
}
|
|
|
|
// Stops the sound
|
|
func stopSound() {
|
|
player?.removeAllItems()
|
|
}
|
|
|
|
// Pauses the sound
|
|
func pauseSound() {
|
|
player?.pause()
|
|
}
|
|
}
|