Skip to content

Instantly share code, notes, and snippets.

@wonder-sk
Last active August 29, 2015 14:13
Show Gist options
  • Save wonder-sk/5ed604d13379802885c1 to your computer and use it in GitHub Desktop.
Save wonder-sk/5ed604d13379802885c1 to your computer and use it in GitHub Desktop.
Play internet radio
content = """<!DOCTYPE html><html><head>
<script type="text/javascript" src="http://jplayer.org/latest/lib/jquery.min.js"></script>
<script type="text/javascript" src="http://jplayer.org/latest/dist/jplayer/jquery.jplayer.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){ var stream = { title: "ABC Lounge", mp3: "http://listen.radionomy.com/abc-lounge" }, ready = false;
$("#jquery_jplayer_1").jPlayer({ ready: function (event) { ready = true; $(this).jPlayer("setMedia", stream).jPlayer("play"); },
supplied: "mp3", }); });</script></head><body><div id="jquery_jplayer_1" class="jp-jplayer"></div></body></html>"""
from PyQt4.QtWebKit import QWebView
v = QWebView()
v.setHtml(content)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment