Controlling Flash FLV video players in Javascript-open source outside China ArticleThis article introduces javas_flv_player, an open-source player, which encountered some problems during use. For example, when declaring a flash object, if the player is nested in the form, you need to use player_id to save the Flash Object immediately. Otherwise, player_id cannot be found when SWF executes the registration callback function. Because SWF is used to find the global player_id variable, it is impossible to find it in form. The error "player_id" is undefined.
If you want to hide the layers that contain flash in advance, some methods of player_id will show "The object does not support this attribute or method ". This problem has plagued me for a long time. Whether the layer is hidden or not the player_id variable looks the same. Why is there a method? This was also the case when the innerhtml method of Div was used later. After a calm analysis, I thought about the principle and finally found that the SWF was not executed. Although the object is created, the SWF in it is not executed, and some callback functions are registered for player_id in SWF. Therefore, "the object does not support this attribute or method" appears ".
To sum up, div is hidden. Although the object in it has been created, SwF is not executed. Using innerhtml to write data to an object, although the object already exists, SwF has not been executed yet. The solution is to perform subsequent operations after writing data to innerhtml. Use setTimeout ().