It seems that Google Drive access_token expires in 60 minutes.
When I watch my video(120 minutes long), if I don't seek, I can watch until the end of the video.
But if I seek after 60 minites, VLC Player finishes by error.
I think I must pass new access_token to VLC Player.
Can I pass new access_token to VLC Player?
[VLCGoogleDriveController.m]
Code: Select all
- (void)streamFile:(GTLRDrive_File *)file
{
NSString *token = [((GTMAppAuthFetcherAuthorization *)self.driveService.authorizer).authState.lastTokenResponse accessToken];
NSString *urlString = [NSString stringWithFormat:@"https://www.googleapis.com/drive/v3/files/%@?alt=media", file.identifier];
VLCPlaybackService *vpc = [VLCPlaybackService sharedInstance];
VLCMedia *media = [VLCMedia mediaWithURL:[NSURL URLWithString:urlString]];
[media addOptions:@{@"http-token" : token}];
VLCMediaList *medialist = [[VLCMediaList alloc] init];
[medialist addMedia:media];
[vpc playMediaList:medialist firstIndex:0 subtitlesFilePath:nil];
}