示例#1
0
    def test_init(self):
        movie_file = trunk_relative_path('examples/data/blue.mpg')
        movie = gmovie.Movie(movie_file)
        self.assertEqual(movie, True)

        #screen = pygame.display.get_surface()
        #movie = pygame.gmovie.Movie(filename, screen)
        #self.assertEqual(movie, True)

        del movie
示例#2
0
    def test_rewind(self):
        movie_file = trunk_relative_path('examples/data/blue.mpg')
        movie = gmovie.Movie(movie_file)

        movie.play(-1)
        time.sleep(2)
        #equivalent to stop without a time-argument
        movie.rewind()
        self.assertEqual(movie.playing, False)
        self.assertEqual(movie.paused, False)

        del movie
示例#3
0
    def test_resize(self):
        movie_file = trunk_relative_path('examples/data/blue.mpg')
        movie = gmovie.Movie(movie_file)

        movie.play(-1)
        movie.resize(movie.width / 2, movie.height / 2)
        #equivalent to stop without a time-argument

        self.assertEqual(movie.height, 100)
        self.assertEqual(movie.width, 100)

        del movie
示例#4
0
    def test_stop(self):
        movie_file = trunk_relative_path('examples/data/blue.mpg')
        movie = gmovie.Movie(movie_file)

        self.assertEqual(movie.playing, False)
        movie.play(-1)
        self.assertEqual(movie.playing, True)
        self.assertEqual(movie.paused, False)
        movie.stop()
        self.assertEqual(movie.playing, False)
        self.assertEqual(movie.paused, False)

        del movie
示例#5
0
# to be on time for rendering that surface.
# Without a surface argument, the ffmpeg-wrapper uses the sdl_overlay library. 
#screen=pygame.display.set_mode((640, 368))

info = movie.MovieInfo(filename)
print ()
print (info.width, info.height)
print (info.filename)
print (info.aspect_ratio)
print (info.duration)
print (info.audio_codec)
print (info.video_codec)

try:
    #this is to test that the movie module tests filenames to make sure they exist
    m=movie.Movie("gsdsjgsdj")
except Exception:
    e = pygame.compat.geterror()
    print (e)
    del m


m = movie.Movie(filename)
print (m.paused)  #always False, unless .pause has been called
print (m.playing) #False until play has been called. Will return to false when
print (m.finished)# .stop() has been called.
                
print (m.width)   #default size values of the video file
print (m.height)  # They can be modified on the fly, as will be demonstrated.

print (m)         #calls __repr__, which will show the filename, and the current 
示例#6
0
    def test_height(self):
        movie_file = trunk_relative_path('examples/data/blue.mpg')
        movie = gmovie.Movie(movie_file)
        self.assertEqual(movie.height, 200)

        del movie