How to play videos from a URL into an iphone app w

2019-09-02 15:52发布

I have an iphone app which requires the videos to be played from the URL.

I dont want to download the whole videos just as it eventually slows down my app.

I want to play the videos in a way that it buffers in between and then plays.

How to play videos from a URL into an iphone app with buffering?

2条回答
手持菜刀,她持情操
2楼-- · 2019-09-02 16:06

Try Like this....

NSString *url = @"www.youtube.com/xyz";
NSString *htmlString =[NSString stringWithFormat:@"<object width='212' height='172'><param name='movie' value='%@'></param><param name='wmode' value='transparent'></param><embed src='%@'type='application/x-shockwave-flash' wmode='transparent' width='980' height='965'></embed></object>",url,url];

[myWebview loadHTMLString:htmlString baseURL:nil];
查看更多
贪生不怕死
3楼-- · 2019-09-02 16:09

do you have own server for streaming?

then,

NSURL *url = [NSURL URLWithString: @"http://STREAMING URL"];
[myMPMoviePlayerController setContentURL: url];
[myMPMoviePlayerController play];
查看更多
登录 后发表回答