-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNew Text Document.txt
28 lines (23 loc) · 1.1 KB
/
New Text Document.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
####daroo which payar milaa de
#### strange magic [movie]
def play(self, filename):
import sys
##Note we call the GetHandle() method of a control in the window/frame, not the wxFrame itself
self.hwnd = self.GetChildren()[0].GetHandle()
if sys.platform == "win32":
os.environ['SDL_VIDEODRIVER'] = 'windib'
os.environ['SDL_WINDOWID'] = str(self.hwnd) #must be before init
## NOTE WE DON'T IMPORT PYGAME UNTIL NOW. Don't put "import pygame" at the top of the file.
import pygame
pygame.display.init()
self.movie = pygame.movie.Movie(filename)
if self.movie.has_video():
w,h = self.movie.get_size()
if w<=0 or h<=0: w,h = 1,1
else:
#? need something to display if audio only.
#We can't have a 0,0 canvas, pygame/SDL doesn't like that.
w,h = 1,1
self.display = pygame.display.set_mode((w,h)) #size no matter
self.movie.set_display(self.display)
self.movie.play()