问题标签 [avplayeritem]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
427 浏览

ios - seekToTime 不适用于 iOS 9 中的实时资产

在播放实时视频时,SeekToTime 方法在 iOS 9 中不起作用。即使在寻找之后,视频也不会从寻找的位置播放。在以前的 iOS 版本中,它可以正常工作。以下是代码...

-(无效)加载视频{

}

-(IBAction)SeekToTimeInVideo:(id)sender{ [播放器暂停];

}

任何想法 ??这是iOS 9中的错误吗?

0 投票
1 回答
3061 浏览

ios - 如何获得 AvPlayer 持续时间 - Swift

如何让AvPlayerAvAudioPlayer一样工作。我的意思是,我似乎根本无法获得工作时间。这是我需要转换为AvPlayer的内容:

这是我已经尝试过的:

我已经搜索了好几天,Apple 的文档很难辨认。我什至试过

self.player.currentItem.asset.duration

来自:如何从 AVPlayer(不是 AVAudioPlayer)获取持续时间?

任何帮助将非常感激。

0 投票
0 回答
59 浏览

swift - Mp3 文件无法快速运行,但它正在在线流中运行

我的本地路径

file:///var/mobile/Containers/Data/Application/AF374CD7-0634-4162-A735-95EEB2878EA7/Documents/27386390cd5515bfc01a8a5573a4ae2d764268c3.mp3

0 投票
1 回答
731 浏览

ios - 为什么 avplayer 时间在 iOS 中不正确

我的公司需要一个视频应用程序,所以我昨天开始工作。

你可以看到这个 avplayer 的代码:

你可以看到这段代码。方法'addProgressObserver'可以获得播放时间:

KVO 方法可以监听一个属性(属性的名称是'status'),并获取视频的总时间:

但是,构建此代码并运行 ipad 3 (ios 8.1),我可以找到一个问题:

视频播放完成,但self.playerProgressDuration不能等于self.playerTotalDuration!

于是我加了一条通知:AVPlayerItemDidPlayToEndTimeNotification,但是通知无法执行!

问题: 1、视频播放完毕,为什么self.playerProgressDuration不能等于self.playerTotalDuration?2、视频播放完毕,为什么不执行通知?

请帮助我,谢谢。

0 投票
1 回答
1518 浏览

ios - 如何在ios中将AVPlayer缓冲区设置为空

我在我的应用程序中使用 AVPlayer 播放视频。

在我的应用程序中,我添加了播放下一个/上一个视频的功能,所以我如何设置空缓冲区。

因此,如果有人对此有解决方案,请帮助我。

0 投票
2 回答
3049 浏览

swift - AVAsset 方向/旋转问题

尝试使用Ray 很棒的教程来解决方向问题。

左 - 视频的外观(纵向),右 - 不需要的旋转结果

在此处输入图像描述

使用的代码

有什么建议么?

0 投票
2 回答
5073 浏览

ios - AVPlayer 抛出:“内部错误:重启太远了”

我正在观察 AVPlayer 的 KVO AVPlayerItemNewErrorLogEntryNotification,发现以下错误:

  • errorStatusCode:-12645 errorDomain :CoreMediaErrorDomain errorComment:Internal error: restart too far ahead (-1.4084s)

我无法理解以下行的真正含义。

“内部错误:重启太早了”

谁能帮我找到这个问题的根本原因。

0 投票
0 回答
1230 浏览

ios - 密钥“播放器”已更改,但未发送适当的 KVO 通知

我在我的类 PCSPlayerNotification 中观察到 AVPlayer 对象 KVO 通知,我发现了以下崩溃。我无法重现这个问题,而且我很少遇到这个问题。我读了这个http://www.cocoabuilder.com/archive/cocoa/204196-cannot-remove-observer-error.html,我发现问题的原因一定是AVPlayer发送的KVO通知。但不确定如何解决,谁能帮我解决这个问题。

问题 :

碰撞 :

0 投票
1 回答
652 浏览

swift - AVPlayerItem's canPlaySlowForward property never called

I'm trying to enable slow playback rate for a video I'm playing using AVPlayerLayer. To do so the documentation states it will enable rate in the range of 0.0 - 1.0 if the AVPlayerItem returns true for canPlaySlowForward. This property is readonly, so you need to subclass AVPlayerItem and override this property to accomplish this. I've done that, but the video still does not playing at a slow rate, it's always the 1.0 rate. It never even calls the canPlaySlowForward property. Why is this?

Playing the video:

The only other thing I do related to video/audio is prevent it from stopping background audio, via:

The video file does not include an audio track but this was still necessary to include.

0 投票
1 回答
557 浏览

swift - tvOS AVPlayerItem 外部图稿元数据大小

好的,所以我将图像添加到 AVPlayerViewController 的 Info 选项卡中,如下所示:

我只是想知道如何使该图像更大,它显示为一张小图片(65x97),但实际上它是 320x480,因此它应该看起来更大。如何增加尺寸?