How to stream audio for only a known duration using swift
问题 I'm using AVPlayer (I don't need to, but I wanna stream it and start playing as soon as possible) to play an m4a file (it's an iTunes audio preview). Only I only want it to play a part of that file. I'm able to set a start time but not an end time. Using a timer is not working because I'm using URL as a http address. I'm playing as it loads, without downloading the file. I also saw solutions in Objective-C to use KVO to know when music starts playing but I'm thinking this is not the best