IOS app calling url video file but no player to see the video. debug screen is here
if([_mServiceID isEqualToString:@"movFilePlay"] == YES)
{
NSString* path = [StandardPlugin.FCM_URL stringByAppendingString:[dic strValueForKey:@"filePath"]];
//NSString *path = [[NSBundle mainBundle]bundlePath];
NSURL *filePath = [NSURL fileURLWithPath:path];
AVPlayer *player =[AVPlayer playerWithURL:filePath];
UIPageViewController *controller= [[UIPageViewController alloc]init];
//controller.player = player;
[self.playerViewController addChildViewController:controller];
// controller.player = player;
[player play];
when I press the file to open video loads for a second and player will disappear. Please help me thanks! Iphone creen there is tiny picture of video
CodePudding user response:
// 找的链接,可能已过期
NSString* onlineVideoFilePathStr = @"http://vodkgeyttp9.vod.126.net/vodkgeyttp8/pLe5UjdH_7088357_hd.mp4?wsSecret=3407504c27d588bd72f45562e491ef19&wsTime=1559208462&ext=NnR5gMvHcZNcbCz592mDGUGuDOFN18isir07K1EOfL3DA/Lg/vnQozcajtXTmTYynMXslak4S5ceCtQtxSBm80drT0XNo7yBQA/XVpOSilHsKsAGdInnG51QYQ7oEjcAhYcDl8crv/b/DUIrVdVC5nHgE0/mBeAQblajNfkskgDcbRj2543qIHELWaYB6Yvxn5x+lNAmBadQ/ibVtO3RJTx6xTwPSZnvT7ipiNC1OU83ohkF0TdctDfYv6C69xA1";
NSURL* videoUrl = [NSURL URLWithString:onlineVideoFilePathStr];
AVPlayerItem* playerItem = [[AVPlayerItem alloc] initWithURL:videoUrl];
_player = [[AVPlayer alloc] initWithPlayerItem:playerItem];
[self.player play];
CodePudding user response:
Solution
HTML5 video tag -> loop muted autoplay playsinline
Just added these codes in web page in video tag.