|
hfeist, Jr. Member
Posted: 15 March 2014 10:21 PM Total Posts: 37
Using the code below i can get video to play within the IOS simulator within FlashBuilder but not on the iPad itself.
Any ideas?
//video texture var vt:VideoTexture = new VideoTexture("PicassoPtgOnGlass8fps_1_1.flv", 256, 256, true,true); var tm:TextureMaterial = new TextureMaterial(vt, true); var planeGeom:PlaneGeometry = new PlaneGeometry(1024, 730, 1, 1, false, true); planeMesh = new Mesh(planeGeom, tm); scene.addChild(planeMesh); planeMesh.y=365; videoMaterial = new TextureMaterial(videoBitmapTexture = new BitmapTexture(new BitmapData(512, 512, true, 0xFFFF0000)), false, true);
|
|
theMightyAtom, Sr. Member
Posted: 16 March 2014 09:52 AM Total Posts: 669
[ # 2 ]
Is the video streaming over the net when on iPad? You get a security violation if you try to capture from a video that’s not in the same domain.
Good Luck!
|
hfeist, Jr. Member
Posted: 17 March 2014 02:30 AM Total Posts: 37
[ # 3 ]
No it isn’t streaming—it’s an flv.
I should mention that elsewhere in the project I have flv’s playing just fine on the iPad. I have even succeeded in getting video from the camera to play this way.
What I’m trying to do is get it to work also as a videotexture on a plane in away3d. As I mentioned it plays okay on a plane while in development in FlashBuilder’s IOS simulator. But when it’s compiled as .ipa and on the iPad itself it fails to appear.
|
theMightyAtom, Sr. Member
Posted: 17 March 2014 07:40 AM Total Posts: 669
[ # 4 ]
Can you display the video on the stage?
If so you can always bypass the VideoTexture (not sure how that works internally) and use an ordinary BitmapTexture, and use that’s BitmapData to capture the video. Worth a try!
Cheers
|
hfeist, Jr. Member
Posted: 18 March 2014 05:56 PM Total Posts: 37
[ # 5 ]
Well I gave that a try as well but alas with the same result. The new code below works great but not on the iPad. I can sense that there’s something happening on the plane because whenever the camera is looking at it things get a bit sluggish then improve when it looks away.
private function playVideo():void{ var container:ObjectContainer3D = new ObjectContainer3D(); view.scene.addChild(container); var planeGeom:PlaneGeometry = new PlaneGeometry(640, 480, 1, 1, false, true); var planeMesh:Mesh = new Mesh(planeGeom); container.addChild(planeMesh); var material:TextureMaterial = new TextureMaterial(bitmapTexture = new BitmapTexture(new BitmapData(512, 512, true, 0xFFFF0000)), false, true); planeMesh.material = material; planeMesh.y=240; simpleVideoPlayer = new SimpleVideoPlayer(); simpleVideoPlayer.source = "matisseCuttingUp8fps_1_1.flv"; simpleVideoPlayer.width = 640; simpleVideoPlayer.height = 480; simpleVideoPlayer.loop = true; simpleVideoPlayer.play();
addEventListener(Event.ENTER_FRAME, videoEnterFrameHandler); function videoEnterFrameHandler(e:Event):void {
var bitmapData:BitmapData = bitmapTexture.bitmapData; bitmapData.lock(); bitmapData.fillRect(bitmapData.rect, 0); bitmapData.draw(simpleVideoPlayer.container); bitmapData.unlock(); bitmapTexture.invalidateContent(); view.render(); } }
|
Beek, Member
Posted: 18 March 2014 11:53 PM Total Posts: 67
[ # 6 ]
I read somewhere that FLVs are no good on iPad, and it’s better to use MP4s with h.264 encoding.
|
hfeist, Jr. Member
Posted: 19 March 2014 09:33 PM Total Posts: 37
[ # 7 ]
I really got my hopes up with that suggestion. Sigh…
|
Beek, Member
Posted: 19 March 2014 11:47 PM Total Posts: 67
[ # 8 ]
This is the post I was thinking of
http://swfhead.com/blog/?p=1617
. FLVs play terribly. F4Vs do NOT work. At all. Don’t bother. Use MP4. Encoding settings should be :
• H.264
• TV Standard: NTSC
• Profile/Level: Baseline 3.1 (Though I think High 3.1 looks better it also makes for larger file size.)
• Bitrate: CBR at 1.1
|
hfeist, Jr. Member
Posted: 20 March 2014 02:26 AM Total Posts: 37
[ # 9 ]
Thanks for all the ideas and link. I believe that post is referring to getting video to play on the stage in iPad. I have good luck there but not in getting it to play on a plane in away3d 4. I gave it a try anyway but no luck—just a black plane.
|
hfeist, Jr. Member
Posted: 04 April 2014 01:54 AM Total Posts: 37
[ # 10 ]
Well I finally have video playing on a plane in away3D on an iPad. The solution was to encode it as FLV, web 320x240, On2 VP6.
Simple as it appears, this code works fine:
var vt:VideoTexture = new VideoTexture("PicassoPtgOnGlass8fps.flv", 512, 512, true,true); var tm:TextureMaterial = new TextureMaterial(vt, true); tm.bothSides = true; var planeGeom:PlaneGeometry = new PlaneGeometry(640, 480, 1, 1, false, true); planeMesh = new Mesh(planeGeom, tm); planeMesh.y=240; scene.addChild(planeMesh);
|