![]() |
![]() |
||||||
|
|||||||
| Tags: |
![]() |
|
|||
|
I think I found the issue...
It wasn't the code, it was the FLV file itself. I think it was encoded wrong... So I used another FLV that I encoded myself and it seemed to work fine. However, If I don't add any cuePoints or Keyframes when I encode the FLV, would that allow me to add them in my Flex app without issue? |
| Sponsored Links |
|
|||
|
I experimented with the playheadTime property and learned that you cannot set
it to an exact time unless it coincides with a keyframe (see explanation below). See an example here: http://www.anaheimwib.com/_comps/video/ (I'll leave it up for a couple of days). This will let you experiment with different times to see where the playhead moves to. Essentially, what happens when you set playheadTime is that it will move to the first keyframe AFTER the cuepoint. I used After Effects to create the FLV and set the cuepoints (see details below). By default, the Adobe Media Encoder set the keyframes at 2-second intervals. Note that in the application example I posted, you cannot move the playhead to any other value except 2 seconds, 4 seconds, 6 seconds etc. Any value you input in between these 2-second keyframe intervals will move the playhead to the next keyframe downstream in the file. (Note: this test is for progressive download, not streaming) So, unless your cue points match up exactly with a keyframe, you will not be able to move the playhead exactly to that cuepoint. Settings the keyframes manually might help you, but keep in mind that overriding the encoder keyframe placement can degrade video quality in some cases and you'd have to increase the bitrate to compensate, resulting in a larger file (this is a whole 'nother topic I won't get into here, but it involves how the encoder is compressing the frames). Video details: Used the Adobe Media Encoder in After Effects CS3. frame rate: 24 fps (set to match Flex's default frame rate) bitrate: 400 kbps no audio codec: On2 VP6 cue points were encoded at 0, 11, 22, 33, 56, 69, 82, 108 and 120 seconds, as rckehoe used in his example. Let me know if this was helpful. <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initApp()" viewSourceURL="srcview/index.html"> <mx:Script> <![CDATA[ private function initApp():void{ trace('stop'); } private function stopVid(event:MouseEvent):void{ vidPlayer.stop(); } private function pauseVid(event:MouseEvent):void{ vidPlayer.pause(); } private function playVid(event:MouseEvent):void{ vidPlayer.play(); } private function setPlayheadTime(event:MouseEvent):void{ vidPlayer.playheadTime = Number(tiPlayheadTime.text); vidPlayer.pause(); } ]]> </mx:Script> <mx:VideoDisplay id="vidPlayer" x="188" y="28" source="assets/videos/test_video.flv" width="320" height="240"/> <mx:Button id="btnSeek" x="315" y="334" label="Set Playhead" click="setPlayheadTime(event)"/> <mx:TextInput id="tiPlayheadTime" x="283" y="304"/> <mx:HBox x="188" y="276" width="320" height="22" horizontalAlign="center"> <mx:Button id="btnPlay" label="Play" click="playVid(event)"/> <mx:Button id="btnPause" label="Pause" click="pauseVid(event)"/> <mx:Button id="btnStop" label="Stop" click="stopVid(event)"/> </mx:HBox> <mx:Label x="188" y="306" text="Jump to Time:" textAlign="right"/> <mx:Label x="516" y="228" text="Current Playhead Time:"/> <mx:Text id="txtPlayheadTime" text="{vidPlayer.playheadTime.toFixed(4)}" x="516" y="247" width="138" height="18"/> </mx:Application> |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise