java - JWPlayer in Webview doesn't work Android Studio -
i don't know why iframe doesn't want work, use html external file in asset folder. iframe appears, it's written : error loading player: no playable sources found.
here code :
protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); webview wv = (webview) findviewbyid(r.id.webcamview); websettings websettings = wv.getsettings(); websettings.setbuiltinzoomcontrols(true); wv.getsettings().setjavascriptenabled(true); wv.loadurl("file:///android_asset/test.html"); }
here html :
<!doctype html public "-//w3c//dtd html 4.01 transitional//en"> <html><head> <title>bundoran surf co</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <script async="" src="//www.google-analytics.com/analytics.js"></script><script> (function(i,s,o,g,r,a,m){i['googleanalyticsobject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new date();a=s.createelement(o), m=s.getelementsbytagname(o)[0];a.async=1;a.src=g;m.parentnode.insertbefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'ua-40971454-1', 'myipstream.com'); ga('send', 'pageview'); </script><script src="http://jwpsrv.com/library/bkfmkfnaeeke5iiacp8kuw.js"></script><style type="text/css"></style><script src="http://p.jwpcdn.com/6/11/jwpsrv.js"></script><script src="http://p.jwpcdn.com/6/11/sharing.js"></script><script src="http://p.jwpcdn.com/6/jwpsrv_frq.js"></script><style type="text/css"></style></head> <body> <div id="banner"></div> <div id="my-video"></div> <div align="center" id="playerkqlqhedy5doy_wrapper" style="position: relative; display: block; width: 1000px; height: 600px; overflow:auto;-webkit-overflow-scrolling:touch"><a id="beforeswfanchor0" href="#playerkqlqhedy5doy" tabindex="0" title="flash start" style="border:0;clip:rect(0 0 0 0);display:block;height:1px;margin:-1px;outline:none;overflow:hidden;padding:0;position:absolute;width:1px;" data-related-swf="playerkqlqhedy5doy"></a><object type="application/x-shockwave-flash" data="http://p.jwpcdn.com/6/11/jwplayer.flash.swf" width="100%" height="100%" bgcolor="#000000" id="playerkqlqhedy5doy" name="playerkqlqhedy5doy" class="jwswf swfprev-beforeswfanchor0 swfnext-afterswfanchor0" tabindex="0"><param name="allowfullscreen" value="true"><param name="allowscriptaccess" value="always"><param name="seamlesstabbing" value="true"><param name="wmode" value="opaque"></object><a id="afterswfanchor0" href="#playerkqlqhedy5doy" tabindex="0" title="flash end" style="border:0;clip:rect(0 0 0 0);display:block;height:1px;margin:-1px;outline:none;overflow:hidden;padding:0;position:absolute;width:1px;" data-related-swf="playerkqlqhedy5doy"></a><div id="playerkqlqhedy5doy_aspect" style="display: none;"></div><div id="playerkqlqhedy5doy_jwpsrv" style="position: absolute; top: 0px; z-index: 10;"></div><div id="playerkqlqhedy5doy_sharing" style="position: absolute; top: 0px; z-index: 11;"></div></div> <script type="text/javascript"> jwplayer('playerkqlqhedy5doy').setup({ playlist: [{ image: "http://www.bundoransurfco.com/wp-content/uploads/2010/12/homepage_offers1.jpg", sources: [{ file: "http://144.76.75.86/hls/bundoransurfco/playlist.m3u8" }] }], height: 200, primary: "flash", width: 315, controls: true, autostart: true, androidhls: true, sharing: true }); </script> <style type="text/css"> #playerkqlqhedy5doy_wrapper { left:0em; right:0em; top:12.2em; bottom:-5em; max-width: 100%; max-height: 100%; } #photo{ position:fixed; max-width: 100%; top:50px; left : 0em; right:0em; display:block; } iframe, object, embed { position:relative; } </style> <span id="photo" align="middle"> <img src="http://myipstream.com/images/bundoran.jpeg" width="139" height="50" alt="@ surf co"> </body></html>
here logcat (updated):
04-27 10:42:55.814 11616-11616/jardelcompany.test v/webviewchromiumfactoryprovider﹕ binding chromium main looper looper (main, tid 1) {528248fc} 04-27 10:42:55.814 11616-11616/jardelcompany.test i/libraryloader﹕ expected native library version number "",actual native library version number "" 04-27 10:42:55.814 11616-11616/jardelcompany.test i/chromium﹕ [info:library_loader_hooks.cc(116)] chromium logging enabled: level = 0, default verbosity = 0 04-27 10:42:55.818 11616-11616/jardelcompany.test i/browserstartupcontroller﹕ initializing chromium process, renderers=0 04-27 10:42:55.834 11616-11616/jardelcompany.test e/audiomanagerandroid﹕ bluetooth permission missing! 04-27 10:42:55.854 11616-11616/jardelcompany.test d/libegl﹕ loaded /system/lib/egl/libegl_genymotion.so 04-27 10:42:55.858 11616-11616/jardelcompany.test d/﹕ hostconnection::get() new host connection established 0xb8f59b48, tid 11616 04-27 10:42:55.874 11616-11616/jardelcompany.test d/libegl﹕ loaded /system/lib/egl/libglesv1_cm_genymotion.so 04-27 10:42:55.874 11616-11616/jardelcompany.test d/libegl﹕ loaded /system/lib/egl/libglesv2_genymotion.so 04-27 10:42:55.918 11616-11616/jardelcompany.test w/chromium﹕ [warning:mailbox_synchronizer.cc(36)] mailboxsync not supported due missing egl image/fence support 04-27 10:42:55.942 11616-11616/jardelcompany.test d/dalvikvm﹕ gc_for_alloc freed 148k, 6% free 3710k/3928k, paused 3ms, total 3ms 04-27 10:42:55.946 11616-11616/jardelcompany.test d/dalvikvm﹕ gc_for_alloc freed 4k, 6% free 3927k/4152k, paused 3ms, total 3ms 04-27 10:42:55.950 11616-11616/jardelcompany.test i/dalvikvm-heap﹕ grow heap (frag case) 6.320mb 2536932-byte allocation 04-27 10:42:55.954 11616-11626/jardelcompany.test d/dalvikvm﹕ gc_for_alloc freed <1k, 4% free 6405k/6632k, paused 3ms, total 3ms 04-27 10:42:56.010 11616-11640/jardelcompany.test w/chromium﹕ [warning:proxy_service.cc(890)] pac support disabled because there no system implementation 04-27 10:42:56.294 11616-11616/jardelcompany.test w/egl_genymotion﹕ eglsurfaceattrib not implemented 04-27 10:42:56.298 11616-11616/jardelcompany.test e/openglrenderer﹕ getting max_texture_size gradiencache 04-27 10:42:56.298 11616-11616/jardelcompany.test e/openglrenderer﹕ max_texture_size: 16384 04-27 10:42:56.314 11616-11616/jardelcompany.test e/openglrenderer﹕ getting max_texture_size caches::initconstraints() 04-27 10:42:56.322 11616-11616/jardelcompany.test e/openglrenderer﹕ max_texture_size: 16384 04-27 10:42:56.322 11616-11616/jardelcompany.test d/openglrenderer﹕ enabling debug mode 0 04-27 10:42:56.334 11616-11616/jardelcompany.test w/awcontents﹕ nativeondraw failed; clearing background color. 04-27 10:42:56.538 11616-11616/jardelcompany.test w/awcontents﹕ nativeondraw failed; clearing background color. 04-27 10:42:56.830 11616-11616/jardelcompany.test i/chromium﹕ [info:console(1)] "uncaught typeerror: object #<object> has no method 'setsamplefrequency'", source: http://p.jwpcdn.com/6/jwpsrv_frq.js (1) 04-27 10:42:56.954 11616-11616/jardelcompany.test i/chromium﹕ [info:async_pixel_transfer_manager_android.cc(60)] async pixel transfers not supported 04-27 10:42:56.978 11616-11616/jardelcompany.test e/chromium﹕ [error:gles2_cmd_decoder_autogen.h(1082)] [groupmarkernotset(crbug.com/242999)!:28450cb9]gl error :gl_invalid_operation : getintegerv: <- error previous gl command 04-27 10:42:56.998 11616-11616/jardelcompany.test i/chromium﹕ [info:async_pixel_transfer_manager_android.cc(60)] async pixel transfers not supported 04-27 10:42:57.018 11616-11616/jardelcompany.test e/chromium﹕ [error:gles2_cmd_decoder_autogen.h(1082)] [groupmarkernotset(crbug.com/242999)!:c0a812b9]gl error :gl_invalid_operation : getintegerv: <- error previous gl command 04-27 10:42:57.102 11616-11616/jardelcompany.test d/dalvikvm﹕ gc_for_alloc freed 89k, 3% free 7193k/7376k, paused 4ms, total 4ms 04-27 10:43:00.362 11616-11616/jardelcompany.test i/chromium﹕ [info:async_pixel_transfer_manager_android.cc(60)] async pixel transfers not supported 04-27 10:43:00.750 11616-11616/jardelcompany.test e/chromium﹕ [error:gles2_cmd_decoder_autogen.h(1082)] [groupmarkernotset(crbug.com/242999)!:10d3f9b8]gl error :gl_invalid_operation : getintegerv: <- error previous gl command 04-27 10:43:01.518 11616-11616/jardelcompany.test e/chromium﹕ [error:gles2_cmd_decoder_autogen.h(69)] [.video-offscreen-main-thread-0xb91cb650]gl error :gl_invalid_enum : glbindtexture: target gl_texture_external_oes 04-27 10:43:01.518 11616-11616/jardelcompany.test e/chromium﹕ [error:gles2_cmd_decoder_autogen.h(3123)] [.video-offscreen-main-thread-0xb91cb650]gl error :gl_invalid_enum : glproducetexturechromium: target gl_texture_external_oes
don't use rtmp sources. rtmp requires flash, android doesn't support, in app.
so, remove rtmp source, , use hls one.
then, under line:
autostart: true,
add:
androidhls: true,
i not sure if work in app though - may have use http delivered mp4 source.
Comments
Post a Comment