示例#1
0
文件: views.py 项目: Vizualni/hometv
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')
示例#2
0
文件: views.py 项目: Vizualni/hometv
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})
示例#3
0
文件: views.py 项目: Vizualni/hometv
def seek(request, second):
    videocontroller = VideoController()
    videos = videocontroller.getmultimediafiles()
    client = VideoOMXPlayerClient()
    client.seek(second)
    return render(request, 'index.html', {'videos': videos})
示例#4
0
文件: views.py 项目: Vizualni/hometv
def pause(request):
    videocontroller = VideoController()
    videos = videocontroller.getmultimediafiles()
    client = VideoOMXPlayerClient()
    client.pause()
    return render(request, 'index.html', {'videos': videos})
示例#5
0
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")