<s> from . gl_utils import * <EOL> from . texture import VideoTexture <EOL> from . widget import Widget , BGUI_DEFAULT , WeakMethod <EOL> from . image import Image <EOL> class Video ( Image ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , parent , vid , name = None , play_audio = False , repeat = <NUM_LIT:0> , aspect = None , size = [ <NUM_LIT:1> , <NUM_LIT:1> ] , pos = [ <NUM_LIT:0> , <NUM_LIT:0> ] , <EOL> sub_theme = '<STR_LIT>' , options = BGUI_DEFAULT ) : <EOL> """<STR_LIT>""" <EOL> Image . __init__ ( self , parent , name , None , aspect , size , pos , sub_theme = sub_theme , options = options ) <EOL> self . _texture = VideoTexture ( vid , GL_LINEAR , repeat , play_audio ) <EOL> self . _on_finish = None <EOL> self . _on_finish_called = False <EOL> def play ( self , start , end , use_frames = True , fps = None ) : <EOL> self . _texture . play ( start , end , use_frames , fps ) <EOL> self . _on_finish_called = False <EOL> @ property <EOL> def on_finish ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _on_finish <EOL> @ on_finish . setter <EOL> def on_finish ( self , value ) : <EOL> self . _on_finish = WeakMethod ( value ) <EOL> def _draw ( self ) : <EOL> """<STR_LIT>""" <EOL> self . _texture . update ( ) <EOL> Image . _draw ( self ) <EOL> if self . _texture . video . status == <NUM_LIT:3> : <EOL> if self . _on_finish and not self . _on_finish_called : <EOL> self . on_finish ( self ) <EOL> self . _on_finish_called = True </s>
