User Guide
4
Chapter 3: Using Media Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
About Flash Media Server classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
About Client-side classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
About Server-side classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
About client-server communication . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Understanding shared objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
About the Application class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Using the application.onConnect handler . . . . . . . . . . . . . . . . . . . . . . 43
Using the application.onDisconnect handler . . . . . . . . . . . . . . . . . . . 45
Handling events in a component-based application . . . . . . . . . . . . . 46
The Camera class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Turning the camera off. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Suggested settings for different bandwidth speeds . . . . . . . . . . . . . 47
Using one camera in multiple applications . . . . . . . . . . . . . . . . . . . . . 47
The Client class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
The Microphone class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Avoiding audio feedback. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Keeping the microphone on . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
The NetConnection class (client-side) . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
The NetStream class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Using multiple data types in a stream . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Getting the stream time length with ActionScript . . . . . . . . . . . . . . . 50
About buffering a stream. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
About the play status of a stream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
The SharedObject class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
About synchronizing shared objects. . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Using shared object slots effectively . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Flushing remote shared objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Avoiding shared object synchronization problems . . . . . . . . . . . . . . 53
The Stream class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
The System class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
About the Video class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
About creating Video objects dynamically . . . . . . . . . . . . . . . . . . . . . 56
Understanding frame rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Chapter 4: Working With Media Files . . . . . . . . . . . . . . . . . . . . . . 57
Working with video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
About creating live web events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Customizing stream delivery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Working with MP3 files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62