mEventHandler = new EventHandler(this, looper); else if ((looper = Looper.getMainLooper()) != null) mEventHandler = new EventHandler(this, looper); else mEventHandler = null;
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); } }
return; case MEDIA_BUFFERING_UPDATE: onBufferingUpdate(msg); return; case MEDIA_SEEK_COMPLETE:
return; case MEDIA_BUFFERING_UPDATE: onBufferingUpdate(msg); return; case MEDIA_SEEK_COMPLETE:
return; case MEDIA_BUFFERING_UPDATE: onBufferingUpdate(msg); return; case MEDIA_SEEK_COMPLETE:
return; case MEDIA_BUFFERING_UPDATE: onBufferingUpdate(msg); return; case MEDIA_SEEK_COMPLETE:
return; case MEDIA_BUFFERING_UPDATE: onBufferingUpdate(msg); return; case MEDIA_SEEK_COMPLETE:
mEventHandler = new EventHandler(this, looper); else if ((looper = Looper.getMainLooper()) != null) mEventHandler = new EventHandler(this, looper); else mEventHandler = null;
mEventHandler = new EventHandler(this, looper); else if ((looper = Looper.getMainLooper()) != null) mEventHandler = new EventHandler(this, looper); else mEventHandler = null;
mEventHandler = new EventHandler(this, looper); else if ((looper = Looper.getMainLooper()) != null) mEventHandler = new EventHandler(this, looper); else mEventHandler = null;
mEventHandler = new EventHandler(this, looper); else if ((looper = Looper.getMainLooper()) != null) mEventHandler = new EventHandler(this, looper); else mEventHandler = null;
mEventHandler = new EventHandler(this, looper); else if ((looper = Looper.getMainLooper()) != null) mEventHandler = new EventHandler(this, looper); else mEventHandler = null;
/** * Releases resources associated with this MediaPlayer object. It is * considered good practice to call this method when you're done using the * MediaPlayer. */ public void release() { stayAwake(false); updateSurfaceScreenOn(); mOnPreparedListener = null; mOnBufferingUpdateListener = null; mOnCompletionListener = null; mOnSeekCompleteListener = null; mOnErrorListener = null; mOnInfoListener = null; mOnVideoSizeChangedListener = null; mOnCachingUpdateListener = null; mOnHWRenderFailedListener = null; if (mEventHandler != null) mEventHandler.release(); //mEventHandler = null; _release(); closeFD(); mInBuffering = false; mNeedResume = false; }
/** * Releases resources associated with this MediaPlayer object. It is * considered good practice to call this method when you're done using the * MediaPlayer. */ public void release() { stayAwake(false); updateSurfaceScreenOn(); mOnPreparedListener = null; mOnBufferingUpdateListener = null; mOnCompletionListener = null; mOnSeekCompleteListener = null; mOnErrorListener = null; mOnInfoListener = null; mOnVideoSizeChangedListener = null; mOnCachingUpdateListener = null; mOnHWRenderFailedListener = null; if (mEventHandler != null) mEventHandler.release(); //mEventHandler = null; _release(); closeFD(); mInBuffering = false; mNeedResume = false; }
/** * Releases resources associated with this MediaPlayer object. It is * considered good practice to call this method when you're done using the * MediaPlayer. */ public void release() { stayAwake(false); updateSurfaceScreenOn(); mOnPreparedListener = null; mOnBufferingUpdateListener = null; mOnCompletionListener = null; mOnSeekCompleteListener = null; mOnErrorListener = null; mOnInfoListener = null; mOnVideoSizeChangedListener = null; mOnCachingUpdateListener = null; mOnHWRenderFailedListener = null; if (mEventHandler != null) mEventHandler.release(); //mEventHandler = null; _release(); closeFD(); mInBuffering = false; mNeedResume = false; }
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); } }
/** * Releases resources associated with this MediaPlayer object. It is * considered good practice to call this method when you're done using the * MediaPlayer. */ public void release() { stayAwake(false); updateSurfaceScreenOn(); mOnPreparedListener = null; mOnBufferingUpdateListener = null; mOnCompletionListener = null; mOnSeekCompleteListener = null; mOnErrorListener = null; mOnInfoListener = null; mOnVideoSizeChangedListener = null; mOnCachingUpdateListener = null; mOnHWRenderFailedListener = null; if (mEventHandler != null) mEventHandler.release(); //mEventHandler = null; _release(); closeFD(); mInBuffering = false; mNeedResume = false; }
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); } }