ÿþ< ! - -    
 / /   T h i s   s c r i p t   d e t e r m i n e s   c o r r e c t   c o d e   r e q u i r e d   t o   e m b e d   M E D I A   f i l e s    
 / /   f o r   a   l a r g e   n u m b e r   o f   b r o w s e r s ,   i n c l u d i n g   A O L   a n d   W e b T V  
 / /   W i n d o w s   M e d i a   P l a y e r   i s   r e q u i r e d   a n d   a l w a y s   u s e d ,   e x c e p t   f o r   W e b T V  
 / /   W r i t t e n   b y   L e s   G o r v e n ,   h t t p : / / m i d i s t u d i o . c o m /    
 / /   V e r .   4 . 0   ( s i m p l e )   a u t o - s t a r t   p a r a m e t e r   i s   t r u e   -   C r e a t e d :   F e b r u a r y   2 ,   2 0 0 8  
  
 f u n c t i o n   p l a y M e d i a ( m e d i a U R L , r p t , h e i g h t , w i d t h )   {  
  
  
 v a r   m e d i a U R L , r p t , h e i g h t , w i d t h  
  
  
 i f   ( G e t B r o w s e r ( )   = =   " I E " )  
 	 p l a y A l l ( m e d i a U R L , r p t , h e i g h t , w i d t h )   ;      
 e l s e   i f   ( G e t B r o w s e r ( )   = =   " u n k n o w n " )  
 	 e m b e d S o u r c e ( m e d i a U R L , r p t , h e i g h t , w i d t h )   ;  
 e l s e   i f   ( n a v i g a t o r . a p p N a m e . s u b s t r i n g ( 0 , 5 )   = =   " W e b T V " )  
 	 e m b e d S o u r c e ( m e d i a U R L , r p t , h e i g h t , w i d t h )   ;  
 e l s e  
 	 p l a y A l l ( m e d i a U R L , r p t , h e i g h t , w i d t h )   ;  
 }  
  
 f u n c t i o n   e m b e d S o u r c e ( m e d i a U R L , r p t , h e i g h t , w i d t h )   {  
  
         v a r   C o d e G e n   =   " "  
         v a r   m e d i a U R L , r p t , h e i g h t , w i d t h  
   	 	   	  
 	   C o d e G e n   =   ' < e m b e d   s r c = " '   +   m e d i a U R L   +   ' " '   +   ' \ n '   ;  
 	   C o d e G e n   + =   '   h e i g h t = '   +   h e i g h t   +   '   w i d t h = '   +   w i d t h   +   '   a u t o s t a r t = " t r u e " '   +   ' \ n '  
 	   C o d e G e n   + =   '   L O O P = '   +   r p t   +   ' > '  
 	    
         d o c u m e n t . w r i t e ( C o d e G e n )  
  
 }  
  
 f u n c t i o n   p l a y A l l ( m e d i a U R L , r p t , h e i g h t , w i d t h )   {  
 	 	 v a r   C o d e G e n   =   " "    
 	 	 	 	 	   	  
  
 	 	 C o d e G e n   =   ' < e m b e d   t y p e = " a p p l i c a t i o n / x - m p l a y e r 2 "   '   +   ' \ n '   ;  
         	 C o d e G e n   + =   '   p l u g i n s p a g e = " h t t p : / / w w w . m i c r o s o f t . c o m / W i n d o w s / M e d i a P l a y e r / "   '   +   ' \ n '   ;  
 	   	 C o d e G e n   + =   ' N a m e = " P l a y e r "   '   +   ' s r c = " '   +   m e d i a U R L   +   ' "   '   +   ' \ n '   ;  
 	   	 C o d e G e n   + =   ' a u t o S t a r t = 1   '   ;  
 	 	 i f   ( ( h e i g h t   = =   2 4 )   & &   ( w i d t h   = =   2 9 9 ) )    
 	 	 	 C o d e G e n   =   C o d e G e n   +   ' S h o w S t a t u s B a r = 1   ' ;    
 	 	 i f   ( ( h e i g h t   > =   5 0 )   & &   ( h e i g h t   < =   7 5 )   & &   ( w i d t h   > =   2 0 0 ) )    
 	 	 	 C o d e G e n   =   C o d e G e n   +   ' S h o w S t a t u s B a r = 1   ' ;    
 	 	 i f   ( ( h e i g h t   >   7 5 )   & &   ( w i d t h   > =   1 5 0 ) )    
 	 	 	 C o d e G e n   =   C o d e G e n   +   ' S h o w S t a t u s B a r = 0   ' ;    
 	 	 i f   ( ( h e i g h t   < =   4 9 )   & &   ( w i d t h   ! =   2 9 9 ) )  
 	 	 	 C o d e G e n   + =   ' S h o w S t a t u s B a r = 0   ' ;    
 	 	 C o d e G e n   + =   ' e n a b l e C o n t e x t M e n u = 1   c a c h e = 0   '   +   ' \ n '   ;  
 	 	 C o d e G e n   + =   ' p l a y C o u n t = '   +   r p t   +   ' 3 0 0   '   ;  
 	 	 C o d e G e n   + =   ' v o l u m e = - 1   '   ;  
 	 	 C o d e G e n   + =   ' H E I G H T = '   +   h e i g h t   +   '   W I D T H = '   +   w i d t h   +   ' > '  
 	 	 	  
 	 	 	 d o c u m e n t . w r i t e ( C o d e G e n )  
 	  
 }  
  
 f u n c t i o n   G e t B r o w s e r ( )  
 {  
       v a r   a g t = n a v i g a t o r . u s e r A g e n t . t o L o w e r C a s e ( ) ;  
       i f (   ( ( a g t . i n d e x O f ( " m s i e " )   ! =   - 1 )   & &   ( a g t . i n d e x O f ( " o p e r a " )   = =   - 1 ) )   )  
               r e t u r n   " I E " ;  
       e l s e   i f (   ( ( a g t . i n d e x O f ( ' m o z i l l a ' ) ! = - 1 )   & &   ( a g t . i n d e x O f ( ' s p o o f e r ' ) = = - 1 )  
                   & &   ( a g t . i n d e x O f ( ' c o m p a t i b l e ' )   = =   - 1 )   & &   ( a g t . i n d e x O f ( ' o p e r a ' ) = = - 1 )  
                   & &   ( a g t . i n d e x O f ( ' w e b t v ' ) = = - 1 )   & &   ( a g t . i n d e x O f ( ' h o t j a v a ' ) = = - 1 ) )   )  
               r e t u r n   " N e t s c a p e " ;  
       e l s e  
               r e t u r n   " u n k n o w n " ;  
 }  
  
 / / - - >  
 
