Launching android player from kivy -



Launching android player from kivy -

i trying launch media player play hls link kivy+android environment. able launch default media player using sample code got net (given below). have installed improve media player (https://play.google.com/store/apps/details?id=veg.network.mediaplayer) want launched url. thought how can proceed on this? possible create intents kivy? (note: using kivy launcher , not apk (buildozer))

from jnius import autoclass time import sleep # mediaplayer java class mediaplayer = autoclass('android.media.mediaplayer') #mediaplayer = autoclass('veg.network.mediaplayer') # create our player mplayer = mediaplayer() mplayer.setdatasource('http://www.nasa.gov/multimedia/nasatv/ntv-public-ips.m3u8') mplayer.prepare() # play print 'duration:', mplayer.getduration() mplayer.start() print 'current position:', mplayer.getcurrentposition() sleep(50) # after play: mplayer.release()

thx, gl

yes, can create intents kivy same way access other java classes. maybe this:

pythonactivity = autoclass('org.renpy.android.pythonactivity') intent = autoclass('android.content.intent') uri = autoclass('android.net.uri') media_intent = intent(intent.action_view) uri = uri.parse('http://www.nasa.gov/multimedia/nasatv/ntv-public-ips.m3u8') media_intent.setdataandtype(uri, 'video/*') pythonactivity.mactivity.startactivity(media_intent)

android android-mediaplayer kivy pyjnius

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -