@magurp244
i guess i broke something. Although i've examined indentation well, there suppose to be something that i miss.
AT first rewind function worked the least but, no luck with fast forward.
import pyglet
from pyglet.window import key
class Prototype(pyglet.window.Window):
def __init__(self):
super(Prototype, self).__init__(640, 480, resizable=False, fullscreen=False, caption="Test")
self.clear()
self.music = pyglet.media.StaticSource(pyglet.media.load('D:\Müzik\The Chemical Brothers - Galvanize.mp3',streaming=False))
self.player = pyglet.media.Player()
pyglet.clock.schedule_interval(self.update, .01)
def update(self,dt):
if self.player.playing == False:
self.player.queue(self.music)
self.player.play()
#draw screen
self.draw()
def draw(self):
self.clear()
def on_key_press(self,symbol,modifiers):
if symbol == key.UP and self.player.volume < 2.0:
self.player.volume += 0.1
print(self.player.volume)
if symbol == key.DOWN and self.player.volume > 0.0:
self.player.volume -= 0.1
print(self.player.volume)
if symbol == key.LEFT:
print(self.player.time)
if self.playertime - 10.0 < 0.0:
self.player.seek(0.0)
else:
self.player.seek(self.player.time - 10.0)
if symbol == RIGHT:
print(self.player.time)
get_duration = self.player.duration
if self.player.time + 10.0 > get_duration:
self.player.seek(get_duration)
else:
self.player.seek(self.player.time + 10.0)
print(self.player.time)
if symbol == key.ESCAPE:
self.close()
if __name__ == '__main__':
window = Prototype()
pyglet.app.run()