NetStream视频不玩iPad上 [英] Netstream video not playing on iPad

查看:140
本文介绍了NetStream视频不玩iPad上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立一个iPad应用程序使用Flash CS6编译成AIR 3.3的PC上。

I am building an iPad app using Flash CS6 to compile to AIR 3.3 on a PC.

其中一个应用程序的要求是一个视频播放器,可以覆盖与其它显示元件 - 主要为字幕。

One of the app requirements is a video player which can be overlaid with other display element - primarily for subtitles.

我使用的NetStream播放MP4视频(也试图FLVPlayer具有相同的结果)。
当编译在模拟器中运行一切正常,但视频不能播放一次安装在我的测试设备上 - iPad的3
(我在几个月前做了一个简单的测试,并得到了视频与音频播放正确的,但那是CS5.5,AIR 3.1,iPad 2的,我会回到这个设置,但我显然还需要支持iPad3的... )

I am using Netstream to play MP4 video (have also tried FLVPlayer with same results).
Everything works fine when compiled to run in the emulator, but the video doesn't play once installed on my test device - iPad 3.
(I did a simple test a few months ago and got video playing correctly with audio, but that was CS5.5, AIR 3.1, iPad 2. I will return to this setup, but I obviously do also need to support iPad3...)

于是,几个简单的问题第一...
任何人只要有同样的问题?
你知道什么最近已更改iOS上,阻止AIR播放视频?

So, a couple of quick questions first...
Anyone with the same problems?
Do you know if anything has changed recently on iOS that blocks AIR playing video?

我做平常的NetStream /的NetConnection东西,然后通过一个 File.url 的NetStream.play()
这里的code胆量:

I do the usual netstream / netconnection stuff then pass a File.url to netstream.play().
Here are the guts of the code:

var nc:NetConnection = new NetConnection();
var ns:NetStream;
var vid:Video = new Video();
var videoFile:File;
videoFile = File.applicationDirectory;
videoFile = videoFile.resolvePath(Config.VIDEO_DIRECTORY + 'myVideo.mp4');
nc.connect(null);
ns = new NetStream(nc);
ns.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus, false, 0, true);
ns.client = this; // To handle onMetaData & onXMPData
vid.attachNetStream(ns);
vid.smoothing = true;
addChild(vid);
ns.play(videoFile.url);

发布设置是:

Publish settings are:

硬件加速::第2级 - GPU(也试图直接)
  渲染模​​式:: GPU(也试图直接)
  设备:: iPad的
  决议::高(也试图标准)
  包含的文件:: app.swf,app.xml中,资产目录中的视频/图像(图像加载罚款)(包括尝试的MP4,而不是直接在目录中,没有区别)

Hardware acceleration :: Level 2 - GPU (have also tried Direct)
Render Mode :: GPU (have also tried Direct)
Device :: iPad
Resolution :: High (have also tried Standard)
Included files :: app.swf, app.xml, assets directory with video / images (images load fine) (tried including .mp4 directly rather than in directory, no difference)

可以任你帮忙吗?

推荐答案

好,固定。

以上code是正确的(完美的作品),但视频文件是错误的。

The above code is all correct (works perfectly), but the video file was wrong.

我还是不明白为什么,并欢迎有一些反应,但我已经转向。FLV格式的视频,它工作正常。

I still don't understand why, and would welcome some response, but I have switched to .flv formatted video and it works fine.

我是测试该文件是EN codeD iPad和运行良好时,在桌面上的AIR发挥,而当导入到iPad和发挥本地。

The file I was testing was encoded for iPad and ran fine when played in AIR on the desktop, and when imported to the iPad and played natively.

任何有识之士来编码$ P $的pset(我正在运行的Adobe Media恩codeR)的MP4会很有意思。

Any insight to encoding presets (I am running Adobe Media Encoder) for mp4 would be interesting.

这篇关于NetStream视频不玩iPad上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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