ActionScript 3: FLV Queue using netstatus and cuepoints

I am creating a flash site that uses video transitions to move from section to section. Each section background is a photograph of a still frame with a higher resolution than the transition videos themselves, which are scaled during the transition. The first frame of each video transition is the current background image, and the last frame of each video transition is the focus image of the destination. Roughly speaking, this is the alleged flow of navigation on the site:

Rest state:
hi-res image in the foreground, without video elements

The user clicks on the navigation element:
Flash prepares the FLV through the netstream object and buffers it, which is done through the netstream.play () function. After receiving the "Netstatus.Buffer.Full" event, the netstream object is paused and attached to the video object, which is then added to the display list behind the hi-res image in the foreground. Once the video object has been added to the scene, the hi-res image is in the alpha foreground (via animation), leaving only the background video. When the foreground is completed, the video plays in the background. As soon as "NetStream.Play.Stop" is received, the process happens in reverse order; those. a new highly effective foreground image is enlarged by the video layer, and the video is removed from the scene immediately afterwards.

I don’t think that something is wrong (at least in principle) with the flow described above, and it does not seem like it should be so complicated. However, I had no problems with the initial setup of the FLV / video object. At first it seemed that the FLV was not queuing properly, and I mean that the foreground image is welcome to show a white screen, and the video appeared and only started playing after a second or two. (The first frame of the FLV is definitely not white).

, , , netstream 100 "Buffer.Full", , . , dev, . , 2 , ; , , , , .

, bytesLoaded/bytesTotal netStatus, . ; FLV 0,2 FLV THAT , ; , --.

, , , , . !

0
1

FLV - .

, , , . , , . Cuepoints - , - .

+1

Source: https://habr.com/ru/post/1742010/


All Articles