private void updateSub(int subType, byte[] bytes, String encoding, int width, int height) { if (mEventHandler != null) { Message m = mEventHandler.obtainMessage(MEDIA_TIMED_TEXT, width, height); Bundle b = m.getData(); if (subType == SUBTITLE_TEXT) { b.putInt(MEDIA_SUBTITLE_TYPE, SUBTITLE_TEXT); if (encoding == null) { b.putString(MEDIA_SUBTITLE_STRING, new String(bytes)); } else { try { b.putString(MEDIA_SUBTITLE_STRING, new String(bytes, encoding.trim())); } catch (UnsupportedEncodingException e) { Log.e("updateSub", e); b.putString(MEDIA_SUBTITLE_STRING, new String(bytes)); } } } else if (subType == SUBTITLE_BITMAP) { b.putInt(MEDIA_SUBTITLE_TYPE, SUBTITLE_BITMAP); b.putByteArray(MEDIA_SUBTITLE_BYTES, bytes); } mEventHandler.sendMessage(m); } }
private void updateCacheStatus(int type, int info, long[] segments) { if (mEventHandler != null) { Message m = mEventHandler.obtainMessage(MEDIA_CACHING_UPDATE); Bundle b = m.getData(); b.putInt(MEDIA_CACHING_TYPE, type); b.putInt(MEDIA_CACHING_INFO, info); b.putLongArray(MEDIA_CACHING_SEGMENTS, segments); mEventHandler.sendMessage(m); } }
private void updateSub(int subType, byte[] bytes, String encoding, int width, int height) { if (mEventHandler != null) { Message m = mEventHandler.obtainMessage(MEDIA_TIMED_TEXT, width, height); Bundle b = m.getData(); if (subType == SUBTITLE_TEXT) { b.putInt(MEDIA_SUBTITLE_TYPE, SUBTITLE_TEXT); if (encoding == null) { b.putString(MEDIA_SUBTITLE_STRING, new String(bytes)); } else { try { b.putString(MEDIA_SUBTITLE_STRING, new String(bytes, encoding.trim())); } catch (UnsupportedEncodingException e) { Log.e("updateSub", e); b.putString(MEDIA_SUBTITLE_STRING, new String(bytes)); } } } else if (subType == SUBTITLE_BITMAP) { b.putInt(MEDIA_SUBTITLE_TYPE, SUBTITLE_BITMAP); b.putByteArray(MEDIA_SUBTITLE_BYTES, bytes); } mEventHandler.sendMessage(m); } }
private void updateSub(int subType, byte[] bytes, String encoding, int width, int height) { if (mEventHandler != null) { Message m = mEventHandler.obtainMessage(MEDIA_TIMED_TEXT, width, height); Bundle b = m.getData(); if (subType == SUBTITLE_TEXT) { b.putInt(MEDIA_SUBTITLE_TYPE, SUBTITLE_TEXT); if (encoding == null) { b.putString(MEDIA_SUBTITLE_STRING, new String(bytes)); } else { try { b.putString(MEDIA_SUBTITLE_STRING, new String(bytes, encoding.trim())); } catch (UnsupportedEncodingException e) { Log.e("updateSub", e); b.putString(MEDIA_SUBTITLE_STRING, new String(bytes)); } } } else if (subType == SUBTITLE_BITMAP) { b.putInt(MEDIA_SUBTITLE_TYPE, SUBTITLE_BITMAP); b.putByteArray(MEDIA_SUBTITLE_BYTES, bytes); } mEventHandler.sendMessage(m); } }
private void updateSub(int subType, byte[] bytes, String encoding, int width, int height) { if (mEventHandler != null) { Message m = mEventHandler.obtainMessage(MEDIA_TIMED_TEXT, width, height); Bundle b = m.getData(); if (subType == SUBTITLE_TEXT) { b.putInt(MEDIA_SUBTITLE_TYPE, SUBTITLE_TEXT); if (encoding == null) { b.putString(MEDIA_SUBTITLE_STRING, new String(bytes)); } else { try { b.putString(MEDIA_SUBTITLE_STRING, new String(bytes, encoding.trim())); } catch (UnsupportedEncodingException e) { Log.e("updateSub", e); b.putString(MEDIA_SUBTITLE_STRING, new String(bytes)); } } } else if (subType == SUBTITLE_BITMAP) { b.putInt(MEDIA_SUBTITLE_TYPE, SUBTITLE_BITMAP); b.putByteArray(MEDIA_SUBTITLE_BYTES, bytes); } mEventHandler.sendMessage(m); } }
private void updateSub(int subType, byte[] bytes, String encoding, int width, int height) { if (mEventHandler != null) { Message m = mEventHandler.obtainMessage(MEDIA_TIMED_TEXT, width, height); Bundle b = m.getData(); if (subType == SUBTITLE_TEXT) { b.putInt(MEDIA_SUBTITLE_TYPE, SUBTITLE_TEXT); if (encoding == null) { b.putString(MEDIA_SUBTITLE_STRING, new String(bytes)); } else { try { b.putString(MEDIA_SUBTITLE_STRING, new String(bytes, encoding.trim())); } catch (UnsupportedEncodingException e) { Log.e("updateSub", e); b.putString(MEDIA_SUBTITLE_STRING, new String(bytes)); } } } else if (subType == SUBTITLE_BITMAP) { b.putInt(MEDIA_SUBTITLE_TYPE, SUBTITLE_BITMAP); b.putByteArray(MEDIA_SUBTITLE_BYTES, bytes); } mEventHandler.sendMessage(m); } }
private void updateSub(int subType, byte[] bytes, String encoding, int width, int height) { if (mEventHandler != null) { Message m = mEventHandler.obtainMessage(MEDIA_TIMED_TEXT, width, height); Bundle b = m.getData(); if (subType == SUBTITLE_TEXT) { b.putInt(MEDIA_SUBTITLE_TYPE, SUBTITLE_TEXT); if (encoding == null) { b.putString(MEDIA_SUBTITLE_STRING, new String(bytes)); } else { try { b.putString(MEDIA_SUBTITLE_STRING, new String(bytes, encoding.trim())); } catch (UnsupportedEncodingException e) { Log.e("updateSub", e); b.putString(MEDIA_SUBTITLE_STRING, new String(bytes)); } } } else if (subType == SUBTITLE_BITMAP) { b.putInt(MEDIA_SUBTITLE_TYPE, SUBTITLE_BITMAP); b.putByteArray(MEDIA_SUBTITLE_BYTES, bytes); } mEventHandler.sendMessage(m); } }
private static void postEventFromNative(Object mediaplayer_ref, int what, int arg1, int arg2, Object obj) { MediaPlayer mp = (MediaPlayer) (mediaplayer_ref); if (mp == null) return; try { //synchronized (mp.mEventHandler) { if (mp.mEventHandler != null) { Message m = mp.mEventHandler.obtainMessage(what, arg1, arg2, obj); mp.mEventHandler.sendMessage(m); } } catch (Exception e) { Log.e("exception: " + e); } }
private static void postEventFromNative(Object mediaplayer_ref, int what, int arg1, int arg2, Object obj) { MediaPlayer mp = (MediaPlayer) (mediaplayer_ref); if (mp == null) return; try { //synchronized (mp.mEventHandler) { if (mp.mEventHandler != null) { Message m = mp.mEventHandler.obtainMessage(what, arg1, arg2, obj); mp.mEventHandler.sendMessage(m); } } catch (Exception e) { Log.e("exception: " + e); } }
private static void postEventFromNative(Object mediaplayer_ref, int what, int arg1, int arg2, Object obj) { MediaPlayer mp = (MediaPlayer) (mediaplayer_ref); if (mp == null) return; try { //synchronized (mp.mEventHandler) { if (mp.mEventHandler != null) { Message m = mp.mEventHandler.obtainMessage(what, arg1, arg2, obj); mp.mEventHandler.sendMessage(m); } } catch (Exception e) { Log.e("exception: " + e); } }
private static void postEventFromNative(Object mediaplayer_ref, int what, int arg1, int arg2, Object obj) { MediaPlayer mp = (MediaPlayer) (mediaplayer_ref); if (mp == null) return; try { //synchronized (mp.mEventHandler) { if (mp.mEventHandler != null) { Message m = mp.mEventHandler.obtainMessage(what, arg1, arg2, obj); mp.mEventHandler.sendMessage(m); } } catch (Exception e) { Log.e("exception: " + e); } }
private void updateCacheStatus(int type, int info, long[] segments) { if (mEventHandler != null) { Message m = mEventHandler.obtainMessage(MEDIA_CACHING_UPDATE); Bundle b = m.getData(); b.putInt(MEDIA_CACHING_TYPE, type); b.putInt(MEDIA_CACHING_INFO, info); b.putLongArray(MEDIA_CACHING_SEGMENTS, segments); mEventHandler.sendMessage(m); } }
private void updateCacheStatus(int type, int info, long[] segments) { if (mEventHandler != null) { Message m = mEventHandler.obtainMessage(MEDIA_CACHING_UPDATE); Bundle b = m.getData(); b.putInt(MEDIA_CACHING_TYPE, type); b.putInt(MEDIA_CACHING_INFO, info); b.putLongArray(MEDIA_CACHING_SEGMENTS, segments); mEventHandler.sendMessage(m); } }
private void updateCacheStatus(int type, int info, long[] segments) { if (mEventHandler != null) { Message m = mEventHandler.obtainMessage(MEDIA_CACHING_UPDATE); Bundle b = m.getData(); b.putInt(MEDIA_CACHING_TYPE, type); b.putInt(MEDIA_CACHING_INFO, info); b.putLongArray(MEDIA_CACHING_SEGMENTS, segments); mEventHandler.sendMessage(m); } }
private void updateCacheStatus(int type, int info, long[] segments) { if (mEventHandler != null) { Message m = mEventHandler.obtainMessage(MEDIA_CACHING_UPDATE); Bundle b = m.getData(); b.putInt(MEDIA_CACHING_TYPE, type); b.putInt(MEDIA_CACHING_INFO, info); b.putLongArray(MEDIA_CACHING_SEGMENTS, segments); mEventHandler.sendMessage(m); } }
private void updateCacheStatus(int type, int info, long[] segments) { if (mEventHandler != null) { Message m = mEventHandler.obtainMessage(MEDIA_CACHING_UPDATE); Bundle b = m.getData(); b.putInt(MEDIA_CACHING_TYPE, type); b.putInt(MEDIA_CACHING_INFO, info); b.putLongArray(MEDIA_CACHING_SEGMENTS, segments); mEventHandler.sendMessage(m); } }
private static void postEventFromNative(Object mediaplayer_ref, int what, int arg1, int arg2, Object obj) { MediaPlayer mp = (MediaPlayer) (mediaplayer_ref); if (mp == null) return; if (mp.mEventHandler != null) { Message m = mp.mEventHandler.obtainMessage(what, arg1, arg2, obj); mp.mEventHandler.sendMessage(m); } }
private static void postEventFromNative(Object mediaplayer_ref, int what, int arg1, int arg2, Object obj) { MediaPlayer mp = (MediaPlayer) (mediaplayer_ref); if (mp == null) return; try { //synchronized (mp.mEventHandler) { if (mp.mEventHandler != null) { Message m = mp.mEventHandler.obtainMessage(what, arg1, arg2, obj); mp.mEventHandler.sendMessage(m); } } catch (Exception e) { Log.e("exception: " + e); } }