如何为当前的播放时间添加5秒?
其实这是我的代码:
CMTime currentTime = music.currentTime;
Run Code Online (Sandbox Code Playgroud)
我不能使用CMTimeGetSeconds(),因为我需要CMTime格式.
谢谢您的回答...
编辑:如何为CMTime设置变量?
如何将流回放5秒?
这是我在viewDidLoad中的流媒体代码:
AVPlayerItem* playerItem = [AVPlayerItem playerItemWithURL:[NSURL URLWithString:@"http://groove.wavestreamer.com:7321/listen.pls?sid=1"]];
[playerItem addObserver:self forKeyPath:@"timedMetadata" options:NSKeyValueObservingOptionNew context:nil];
music = [[AVPlayer playerWithPlayerItem:playerItem] retain];
[music play];
music = [[AVPlayer playerWithPlayerItem:playerItem] retain];
[music play];
Run Code Online (Sandbox Code Playgroud)
谢谢你的回答......
我想创建一个按钮来静音来自AVPlayer的音频.
为什么我不能将.volume与AVPlayer一起使用,只能使用AVAudioPlayer?还有另一种改变音量的方法吗?
例如 music.volume = 0.0;
谢谢你的回答.
这是我在viewDidLoad中的代码:
AVPlayerItem* playerItem = [AVPlayerItem playerItemWithURL:[NSURL URLWithString:@"http://groove.wavestreamer.com:7321/listen.pls?sid=1"]];
[playerItem addObserver:self forKeyPath:@"timedMetadata" options:NSKeyValueObservingOptionNew context:nil];
music = [[AVPlayer playerWithPlayerItem:playerItem] retain];
[music play];
Run Code Online (Sandbox Code Playgroud)
我的问题:
如何创建一个按钮,在按下流时可以快进/快退5秒?
谢谢您的回答... :)
编辑:我如何添加到我的当前时间...
CMTime currentTime = music.currentTime;
Run Code Online (Sandbox Code Playgroud)
...这5秒?
如何创建水平滚动UITextView?
当我以编程方式设置文本时,它会添加自动换行符,所以我只能垂直滚动...
titleView.text = @"this is a very long text. this is a very long text. this is a very long text. this is a very long text. this is a very long text.";
Run Code Online (Sandbox Code Playgroud)
谢谢你的回答.
编辑:到目前为止我试过这个:
UIScrollview *yourScrollview = [[UIScrollView alloc] initWithFrame:CGRectMake(0 ,0 , self.view.frame.size.width, 50)];
CGFloat textLength = [titleView.text sizeWithFont:titleView.font constrainedToSize:CGSizeMake(9999, 50) lineBreakMode:NSLineBreakByWordWrapping].width;
yourScrollview.contentSize = CGSizeMake(textLength + 200, 500); //or some value you like, you may have to try this out a few times
titleView.frame = CGRectMake(titleView.frame.origin.x, …Run Code Online (Sandbox Code Playgroud)