Is there a way to stream audio file from Google Drive with AVPlayer?
I have tried with both file.downloadUrl and file.webContentLink and it is not working.
Code:
GTLDriveFile *file = [self.data objectAtIndex:indexPath.row];
if (player)
{
[player removeObserver:self forKeyPath:@"status"];
[player pause];
}
player = [AVPlayer playerWithURL:[NSURL URLWithString:file.downloadUrl]];
//or
//player = [AVPlayer playerWithURL:[NSURL URLWithString:file.webContentLink]];
[player addObserver:self forKeyPath:@"status" options:0 context:nil];
if (delegate && [delegate respondsToSelector:@selector(audioPlayerDidStartBuffering)])
[delegate audioPlayerDidStartBuffering];
If it is not possible to stream, is it possible to start download in /tmp folder and play while downloading?