def current_playing(request): client = VideoOMXPlayerClient() current_video = client.status() jsonreturn = dict() jsonreturn['current_playing'] = current_video.getdict() if current_video else {} jsonreturn['isplaying'] = client.isplaying() return HttpResponse(json.dumps(jsonreturn), content_type='application/json')
def play(request, slug): videocontroller = VideoController() video = videocontroller.findvideobyslug(slug) videos = videocontroller.getmultimediafiles() client = VideoOMXPlayerClient() client.play(video) return render(request, 'index.html', {'videos': videos})
def seek(request, second): videocontroller = VideoController() videos = videocontroller.getmultimediafiles() client = VideoOMXPlayerClient() client.seek(second) return render(request, 'index.html', {'videos': videos})
def pause(request): videocontroller = VideoController() videos = videocontroller.getmultimediafiles() client = VideoOMXPlayerClient() client.pause() return render(request, 'index.html', {'videos': videos})
from hometvapp.extras.video import VideoOMXPlayerClient import time print "prije" v = VideoOMXPlayerClient() print "poslije" v.send_command("play") time.sleep(5) v.send_command("pause")