English 中文(简体)
我是否应该停止目前AVPlayer在从另一个URL那里玩音乐时的表演?
原标题:Should I stop current AVPlayer instance when playing music from another URL?

我刚刚创立了AVPlayer,它很好地发挥了音乐作用。 我有两个问题:

  1. How to play another music from another URL (should I stop current player?)
  2. How to show current time of the song in UISlider (actually is it a method that called when the song is playing?)
最佳回答

(1) 如果你使用——(id)initWithURL(NSURL *)URL,那么你就应当停止参与pa、交易和制造新情况。

    AVPlayer *player = [AVPlayer alloc] initWithURL:[NSURL URLWithString:@"http:/someurl.com"]];
    [player play];
    [player pause];
    [player release];

    player = [AVPlayer alloc] initWithURL:[NSURL URLWithString:@"http:/someurl2.com"]];
    [player pause];
    [player release];

如果你使用过感人的话 接着,与LURL一样,也只是一线。

页: 1 The easiest is the accreditation period of the present project 之后,更新了具有这一价值的UISlider。 您可使用国家空间局定期检查期限。

      self.player.currentItem.asset.duration
问题回答

Use -[AVPlayer replaceCurrentItemWithPlayerItem] to replace the current playing item reusing the player instance. You can create an item with an URL or with an asset.

为了知道某一项物品何时能使用通知编号

使用<代码>-[AVPlayer AddPeriodictime Observer forInterval],在参与者玩.期间定期开展某些行动。 See this example:

[self.player addPeriodicTimeObserverForInterval:CMTimeMakeWithSeconds(0.1, 100) 
                                          queue:nil 
                                     usingBlock:^(CMTime time) { 
                                     <# your code will be called each 1/10th second #> 
 }];




相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签