在自定义大小的屏幕中播放视频 - 在 iPhone 中查看 [英] Playing video in custom size screen - view in iPhone

查看:12
本文介绍了在自定义大小的屏幕中播放视频 - 在 iPhone 中查看的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设用户点击一个按钮,视频开始播放.现在播放视频时,始终处于全屏模式.

Suppose user taps on a button and video begins to play. Now when video plays, it always in full screen mode.

视频应以纵向模式播放(但通常视频以横向模式播放).我该怎么做?

Video should be played in a portrait mode (but normally video is played in landscape mode). How can I do this?

推荐答案

@interface MPMoviePlayerController (extend) 
 -(void)setOrientation:(int)orientation animated:(BOOL)value; 
@end 

moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:movieUR]; 
[moviePlayer setOrientation:UIDeviceOrientationPortrait animated:NO]; 
if (moviePlayer) 
{ 
    [self.moviePlayer play]; 
} 

此解决方案将被 Apple 拒绝,因为电影播放器​​的 setOrientation 是私有 API.您需要小心,但它可能适用于越狱 iPhone.

This Solution will be rejected by Apple, as setOrientation for movie player is the Private API. You need to be careful, but it may work on Jailbroke iPhones.

这篇关于在自定义大小的屏幕中播放视频 - 在 iPhone 中查看的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆