Beispiel #1
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   requestWindowFeature(Window.FEATURE_NO_TITLE);
   getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
   setContentView(R.layout.web_video);
   Intent intent = getIntent();
   String videoUrl = intent.getExtras().getString("videoUrl");
   String title = intent.getExtras().getString("fileName");
   //		try {
   //			videoUrl = URLEncoder.encode(intent.getExtras().getString("videoUrl"),charset);
   //			title = URLEncoder.encode(intent.getExtras().getString("fileName"),charset);
   //		} catch (UnsupportedEncodingException e) {
   //			e.printStackTrace();
   //		}
   String ip = intent.getExtras().getString("ip");
   String port = intent.getExtras().getString("port");
   webView = (WebView) findViewById(R.id.webView);
   //		currentDisplay = getWindowManager().getDefaultDisplay();
   //		windowH = currentDisplay.getHeight();
   //		windowW = currentDisplay.getWidth();
   String url = "http://" + ip + ":" + port + "/?videoUrl=" + videoUrl;
   Log.i("wburl", url);
   //		String url = "http://10.168.100.73:6090/myvideo/index.jsp";
   // http://10.168.100.73:6090/myvideo/index.jsp?videoUrl=http://10.168.250.12:8800/lian720p.mp4&w=500&h=400&videoName=年aaa
   WebViewUtil.initWebView(webView, new MyWebViewClient(), new InredisChromeClient(this), url);
 }
 @Override
 public void onSubtitleUpdate(String text) {
   Log.i("onSubtitleUpdate: %s", text);
   if (mOnSubtitleUpdateListener != null) mOnSubtitleUpdateListener.onSubtitleUpdate(text);
 }
 @Override
 public void onSubtitleUpdate(byte[] pixels, int width, int height) {
   Log.i("onSubtitleUpdate: bitmap subtitle, %dx%d", width, height);
   if (mOnSubtitleUpdateListener != null)
     mOnSubtitleUpdateListener.onSubtitleUpdate(pixels, width, height);
 }