Java Code Examples for io.vov.vitamio.utils.Log#i()

The following examples show how to use io.vov.vitamio.utils.Log#i() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MediaScanner.java    From MyHearts with Apache License 2.0 5 votes vote down vote up
public void handleStringTag(String name, byte[] valueBytes, String valueEncoding) {
  String value;
  try {
    value = new String(valueBytes, valueEncoding);
  } catch (Exception e) {
    Log.e("handleStringTag", e);
    value = new String(valueBytes);
  }
  Log.i("%s : %s", name, value);

  if (name.equalsIgnoreCase("title")) {
    mTitle = value;
  } else if (name.equalsIgnoreCase("artist")) {
    mArtist = value.trim();
  } else if (name.equalsIgnoreCase("albumartist")) {
    if (TextUtils.isEmpty(mArtist))
      mArtist = value.trim();
  } else if (name.equalsIgnoreCase("album")) {
    mAlbum = value.trim();
  } else if (name.equalsIgnoreCase("language")) {
    mLanguage = value.trim();
  } else if (name.equalsIgnoreCase("duration")) {
    mDuration = parseSubstring(value, 0, 0);
  } else if (name.equalsIgnoreCase("width")) {
    mWidth = parseSubstring(value, 0, 0);
  } else if (name.equalsIgnoreCase("height")) {
    mHeight = parseSubstring(value, 0, 0);
  }
}
 
Example 2
Source File: MediaScanner.java    From video-player with MIT License 5 votes vote down vote up
public void handleStringTag(String name, byte[] valueBytes, String valueEncoding) {
  String value;
  try {
    value = new String(valueBytes, valueEncoding);
  } catch (Exception e) {
    Log.e("handleStringTag", e);
    value = new String(valueBytes);
  }
  Log.i("%s : %s", name, value);

  if (name.equalsIgnoreCase("title")) {
    mTitle = value;
  } else if (name.equalsIgnoreCase("artist")) {
    mArtist = value.trim();
  } else if (name.equalsIgnoreCase("albumartist")) {
    if (TextUtils.isEmpty(mArtist))
      mArtist = value.trim();
  } else if (name.equalsIgnoreCase("album")) {
    mAlbum = value.trim();
  } else if (name.equalsIgnoreCase("language")) {
    mLanguage = value.trim();
  } else if (name.equalsIgnoreCase("duration")) {
    mDuration = parseSubstring(value, 0, 0);
  } else if (name.equalsIgnoreCase("width")) {
    mWidth = parseSubstring(value, 0, 0);
  } else if (name.equalsIgnoreCase("height")) {
    mHeight = parseSubstring(value, 0, 0);
  }
}
 
Example 3
Source File: MediaScanner.java    From HPlayer with Apache License 2.0 5 votes vote down vote up
public void handleStringTag(String name, byte[] valueBytes, String valueEncoding) {
  String value;
  try {
    value = new String(valueBytes, valueEncoding);
  } catch (Exception e) {
    Log.e("handleStringTag", e);
    value = new String(valueBytes);
  }
  Log.i("%s : %s", name, value);

  if (name.equalsIgnoreCase("title")) {
    mTitle = value;
  } else if (name.equalsIgnoreCase("artist")) {
    mArtist = value.trim();
  } else if (name.equalsIgnoreCase("albumartist")) {
    if (TextUtils.isEmpty(mArtist))
      mArtist = value.trim();
  } else if (name.equalsIgnoreCase("album")) {
    mAlbum = value.trim();
  } else if (name.equalsIgnoreCase("language")) {
    mLanguage = value.trim();
  } else if (name.equalsIgnoreCase("duration")) {
    mDuration = parseSubstring(value, 0, 0);
  } else if (name.equalsIgnoreCase("width")) {
    mWidth = parseSubstring(value, 0, 0);
  } else if (name.equalsIgnoreCase("height")) {
    mHeight = parseSubstring(value, 0, 0);
  }
}
 
Example 4
Source File: MediaScanner.java    From NetEasyNews with GNU General Public License v3.0 5 votes vote down vote up
public void handleStringTag(String name, byte[] valueBytes, String valueEncoding) {
  String value;
  try {
    value = new String(valueBytes, valueEncoding);
  } catch (Exception e) {
    Log.e("handleStringTag", e);
    value = new String(valueBytes);
  }
  Log.i("%s : %s", name, value);

  if (name.equalsIgnoreCase("title")) {
    mTitle = value;
  } else if (name.equalsIgnoreCase("artist")) {
    mArtist = value.trim();
  } else if (name.equalsIgnoreCase("albumartist")) {
    if (TextUtils.isEmpty(mArtist))
      mArtist = value.trim();
  } else if (name.equalsIgnoreCase("album")) {
    mAlbum = value.trim();
  } else if (name.equalsIgnoreCase("language")) {
    mLanguage = value.trim();
  } else if (name.equalsIgnoreCase("duration")) {
    mDuration = parseSubstring(value, 0, 0);
  } else if (name.equalsIgnoreCase("width")) {
    mWidth = parseSubstring(value, 0, 0);
  } else if (name.equalsIgnoreCase("height")) {
    mHeight = parseSubstring(value, 0, 0);
  }
}
 
Example 5
Source File: MediaScanner.java    From NetEasyNews with GNU General Public License v3.0 4 votes vote down vote up
public void setMimeType(String mimeType) {
  Log.i("setMimeType: %s", mimeType);
  mMimeType = mimeType;
  mFileType = MediaFile.getFileTypeForMimeType(mimeType);
}
 
Example 6
Source File: VideoView.java    From NetEasyNews with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onTimedText(String text) {
  Log.i("onSubtitleUpdate: %s", text);
  if (mOnTimedTextListener != null)
    mOnTimedTextListener.onTimedText(text);
}
 
Example 7
Source File: MediaPlayer.java    From NetEasyNews with GNU General Public License v3.0 4 votes vote down vote up
@Override
    public void handleMessage(Message msg) {
      if (mMediaPlayer == null) {
//        //Log.i("MiuiVideo: get message after player released, msg type: " + msg.what);
        return;
      }
      switch (msg.what) {
        case MEDIA_PREPARED:
          if (mOnPreparedListener != null)
            mOnPreparedListener.onPrepared(mMediaPlayer);
          return;
        case MEDIA_PLAYBACK_COMPLETE:
          if (mOnCompletionListener != null)
            mOnCompletionListener.onCompletion(mMediaPlayer);
          stayAwake(false);
          return;
        case MEDIA_BUFFERING_UPDATE:
          onBufferingUpdate(msg);
          return;
        case MEDIA_SEEK_COMPLETE:
          if (isPlaying())
            stayAwake(true);
          if (mOnSeekCompleteListener != null)
            mOnSeekCompleteListener.onSeekComplete(mMediaPlayer);
          return;
        case MEDIA_SET_VIDEO_SIZE:
          if (mOnVideoSizeChangedListener != null)
            mOnVideoSizeChangedListener.onVideoSizeChanged(mMediaPlayer, msg.arg1, msg.arg2);
          return;
        case MEDIA_ERROR:
          Log.e("Error (%d, %d)", msg.arg1, msg.arg2);
          boolean error_was_handled = false;
          if (mOnErrorListener != null)
            error_was_handled = mOnErrorListener.onError(mMediaPlayer, msg.arg1, msg.arg2);
          if (mOnCompletionListener != null && !error_was_handled)
            mOnCompletionListener.onCompletion(mMediaPlayer);
          stayAwake(false);
          return;
        case MEDIA_INFO:
          Log.i("Info (%d, %d)", msg.arg1, msg.arg2);
          if (mOnInfoListener != null)
            mOnInfoListener.onInfo(mMediaPlayer, msg.arg1, msg.arg2);
          return;
        case MEDIA_CACHE:
          return;
        case MEDIA_TIMED_TEXT:
          mData = msg.getData();
          if (mData.getInt(MEDIA_SUBTITLE_TYPE) == SUBTITLE_TEXT) {
            Log.i("Subtitle : %s", mData.getString(MEDIA_SUBTITLE_STRING));
            if (mOnTimedTextListener != null)
              mOnTimedTextListener.onTimedText(mData.getString(MEDIA_SUBTITLE_STRING));
          } else if (mData.getInt(MEDIA_SUBTITLE_TYPE) == SUBTITLE_BITMAP) {
            Log.i("Subtitle : bitmap");
            if (mOnTimedTextListener != null)
              mOnTimedTextListener.onTimedTextUpdate(mData.getByteArray(MEDIA_SUBTITLE_BYTES), msg.arg1, msg.arg2);
          }
          return;
        case MEDIA_CACHING_UPDATE:
          if (mOnCachingUpdateListener != null) {
            int cacheType = msg.getData().getInt(MEDIA_CACHING_TYPE);
            if (cacheType == CACHE_TYPE_NOT_AVAILABLE) {
              mOnCachingUpdateListener.onCachingNotAvailable(mMediaPlayer, msg.getData().getInt(MEDIA_CACHING_INFO));
            } else if (cacheType == CACHE_TYPE_UPDATE) {
              mOnCachingUpdateListener.onCachingUpdate(mMediaPlayer, msg.getData().getLongArray(MEDIA_CACHING_SEGMENTS));
            } else if (cacheType == CACHE_TYPE_SPEED) {
              mOnCachingUpdateListener.onCachingSpeed(mMediaPlayer, msg.getData().getInt(MEDIA_CACHING_INFO));
            } else if (cacheType == CACHE_TYPE_START) {
            	mOnCachingUpdateListener.onCachingStart(mMediaPlayer);
            } else if (cacheType == CACHE_TYPE_COMPLETE) {
            	mOnCachingUpdateListener.onCachingComplete(mMediaPlayer);
            }
          }
          return;
        case MEDIA_NOP:
          return;
        case MEDIA_HW_ERROR:
        	if (mOnHWRenderFailedListener != null)
        		mOnHWRenderFailedListener.onFailed();
        	return;
        default:
          Log.e("Unknown message type " + msg.what);
          return;
      }
    }
 
Example 8
Source File: VideoView.java    From video-player with MIT License 4 votes vote down vote up
@Override
public void onTimedText(String text) {
  Log.i("onSubtitleUpdate: %s", text);
  if (mOnTimedTextListener != null)
    mOnTimedTextListener.onTimedText(text);
}
 
Example 9
Source File: VideoView.java    From video-player with MIT License 4 votes vote down vote up
@Override
public void onTimedTextUpdate(byte[] pixels, int width, int height) {
  Log.i("onSubtitleUpdate: bitmap subtitle, %dx%d", width, height);
  if (mOnTimedTextListener != null)
    mOnTimedTextListener.onTimedTextUpdate(pixels, width, height);
}
 
Example 10
Source File: MediaScanner.java    From video-player with MIT License 4 votes vote down vote up
public void setMimeType(String mimeType) {
  Log.i("setMimeType: %s", mimeType);
  mMimeType = mimeType;
  mFileType = MediaFile.getFileTypeForMimeType(mimeType);
}
 
Example 11
Source File: MediaScanner.java    From video-player with MIT License 4 votes vote down vote up
public void scanFile(String path, long lastModified, long fileSize) {
  Log.i("scanFile: %s", path);
  doScanFile(path, lastModified, fileSize, false);
}
 
Example 12
Source File: VideoView.java    From HPlayer with Apache License 2.0 4 votes vote down vote up
@Override
public void onTimedText(String text) {
  Log.i("onSubtitleUpdate: %s", text);
  if (mOnTimedTextListener != null)
    mOnTimedTextListener.onTimedText(text);
}
 
Example 13
Source File: MediaPlayer.java    From MyHearts with Apache License 2.0 4 votes vote down vote up
@Override
    public void handleMessage(Message msg) {
      if (mMediaPlayer == null) {
//        //Log.i("MiuiVideo: get message after player released, msg type: " + msg.what);
        return;
      }
      switch (msg.what) {
        case MEDIA_PREPARED:
          if (mOnPreparedListener != null)
            mOnPreparedListener.onPrepared(mMediaPlayer);
          return;
        case MEDIA_PLAYBACK_COMPLETE:
          if (mOnCompletionListener != null)
            mOnCompletionListener.onCompletion(mMediaPlayer);
          stayAwake(false);
          return;
        case MEDIA_BUFFERING_UPDATE:
          onBufferingUpdate(msg);
          return;
        case MEDIA_SEEK_COMPLETE:
          if (isPlaying())
            stayAwake(true);
          if (mOnSeekCompleteListener != null)
            mOnSeekCompleteListener.onSeekComplete(mMediaPlayer);
          return;
        case MEDIA_SET_VIDEO_SIZE:
          if (mOnVideoSizeChangedListener != null)
            mOnVideoSizeChangedListener.onVideoSizeChanged(mMediaPlayer, msg.arg1, msg.arg2);
          return;
        case MEDIA_ERROR:
          Log.e("Error (%d, %d)", msg.arg1, msg.arg2);
          boolean error_was_handled = false;
          if (mOnErrorListener != null)
            error_was_handled = mOnErrorListener.onError(mMediaPlayer, msg.arg1, msg.arg2);
          if (mOnCompletionListener != null && !error_was_handled)
            mOnCompletionListener.onCompletion(mMediaPlayer);
          stayAwake(false);
          return;
        case MEDIA_INFO:
          Log.i("Info (%d, %d)", msg.arg1, msg.arg2);
          if (mOnInfoListener != null)
            mOnInfoListener.onInfo(mMediaPlayer, msg.arg1, msg.arg2);
          return;
        case MEDIA_CACHE:
          return;
        case MEDIA_TIMED_TEXT:
          mData = msg.getData();
          if (mData.getInt(MEDIA_SUBTITLE_TYPE) == SUBTITLE_TEXT) {
            Log.i("Subtitle : %s", mData.getString(MEDIA_SUBTITLE_STRING));
            if (mOnTimedTextListener != null)
              mOnTimedTextListener.onTimedText(mData.getString(MEDIA_SUBTITLE_STRING));
          } else if (mData.getInt(MEDIA_SUBTITLE_TYPE) == SUBTITLE_BITMAP) {
            Log.i("Subtitle : bitmap");
            if (mOnTimedTextListener != null)
              mOnTimedTextListener.onTimedTextUpdate(mData.getByteArray(MEDIA_SUBTITLE_BYTES), msg.arg1, msg.arg2);
          }
          return;
        case MEDIA_CACHING_UPDATE:
          if (mOnCachingUpdateListener != null) {
            int cacheType = msg.getData().getInt(MEDIA_CACHING_TYPE);
            if (cacheType == CACHE_TYPE_NOT_AVAILABLE) {
              mOnCachingUpdateListener.onCachingNotAvailable(mMediaPlayer, msg.getData().getInt(MEDIA_CACHING_INFO));
            } else if (cacheType == CACHE_TYPE_UPDATE) {
              mOnCachingUpdateListener.onCachingUpdate(mMediaPlayer, msg.getData().getLongArray(MEDIA_CACHING_SEGMENTS));
            } else if (cacheType == CACHE_TYPE_SPEED) {
              mOnCachingUpdateListener.onCachingSpeed(mMediaPlayer, msg.getData().getInt(MEDIA_CACHING_INFO));
            } else if (cacheType == CACHE_TYPE_START) {
            	mOnCachingUpdateListener.onCachingStart(mMediaPlayer);
            } else if (cacheType == CACHE_TYPE_COMPLETE) {
            	mOnCachingUpdateListener.onCachingComplete(mMediaPlayer);
            }
          }
          return;
        case MEDIA_NOP:
          return;
        case MEDIA_HW_ERROR:
        	if (mOnHWRenderFailedListener != null)
        		mOnHWRenderFailedListener.onFailed();
        	return;
        default:
          Log.e("Unknown message type " + msg.what);
          return;
      }
    }
 
Example 14
Source File: MediaScanner.java    From HPlayer with Apache License 2.0 4 votes vote down vote up
public void setMimeType(String mimeType) {
  Log.i("setMimeType: %s", mimeType);
  mMimeType = mimeType;
  mFileType = MediaFile.getFileTypeForMimeType(mimeType);
}
 
Example 15
Source File: MediaScanner.java    From HPlayer with Apache License 2.0 4 votes vote down vote up
public void scanFile(String path, long lastModified, long fileSize) {
  Log.i("scanFile: %s", path);
  doScanFile(path, lastModified, fileSize, false);
}
 
Example 16
Source File: MediaPlayer.java    From HPlayer with Apache License 2.0 4 votes vote down vote up
@Override
    public void handleMessage(Message msg) {
      if (mMediaPlayer == null) {
//        //Log.i("MiuiVideo: get message after player released, msg type: " + msg.what);
        return;
      }
      switch (msg.what) {
        case MEDIA_PREPARED:
          if (mOnPreparedListener != null)
            mOnPreparedListener.onPrepared(mMediaPlayer);
          return;
        case MEDIA_PLAYBACK_COMPLETE:
          if (mOnCompletionListener != null)
            mOnCompletionListener.onCompletion(mMediaPlayer);
          stayAwake(false);
          return;
        case MEDIA_BUFFERING_UPDATE:
          onBufferingUpdate(msg);
          return;
        case MEDIA_SEEK_COMPLETE:
          if (isPlaying())
            stayAwake(true);
          if (mOnSeekCompleteListener != null)
            mOnSeekCompleteListener.onSeekComplete(mMediaPlayer);
          return;
        case MEDIA_SET_VIDEO_SIZE:
          if (mOnVideoSizeChangedListener != null)
            mOnVideoSizeChangedListener.onVideoSizeChanged(mMediaPlayer, msg.arg1, msg.arg2);
          return;
        case MEDIA_ERROR:
          Log.e("Error (%d, %d)", msg.arg1, msg.arg2);
          boolean error_was_handled = false;
          if (mOnErrorListener != null)
            error_was_handled = mOnErrorListener.onError(mMediaPlayer, msg.arg1, msg.arg2);
          if (mOnCompletionListener != null && !error_was_handled)
            mOnCompletionListener.onCompletion(mMediaPlayer);
          stayAwake(false);
          return;
        case MEDIA_INFO:
          Log.i("Info (%d, %d)", msg.arg1, msg.arg2);
          if (mOnInfoListener != null)
            mOnInfoListener.onInfo(mMediaPlayer, msg.arg1, msg.arg2);
          return;
        case MEDIA_CACHE:
          return;
        case MEDIA_TIMED_TEXT:
          mData = msg.getData();
          if (mData.getInt(MEDIA_SUBTITLE_TYPE) == SUBTITLE_TEXT) {
            Log.i("Subtitle : %s", mData.getString(MEDIA_SUBTITLE_STRING));
            if (mOnTimedTextListener != null)
              mOnTimedTextListener.onTimedText(mData.getString(MEDIA_SUBTITLE_STRING));
          } else if (mData.getInt(MEDIA_SUBTITLE_TYPE) == SUBTITLE_BITMAP) {
            Log.i("Subtitle : bitmap");
            if (mOnTimedTextListener != null)
              mOnTimedTextListener.onTimedTextUpdate(mData.getByteArray(MEDIA_SUBTITLE_BYTES), msg.arg1, msg.arg2);
          }
          return;
        case MEDIA_CACHING_UPDATE:
          if (mOnCachingUpdateListener != null) {
            int cacheType = msg.getData().getInt(MEDIA_CACHING_TYPE);
            if (cacheType == CACHE_TYPE_NOT_AVAILABLE) {
              mOnCachingUpdateListener.onCachingNotAvailable(mMediaPlayer, msg.getData().getInt(MEDIA_CACHING_INFO));
            } else if (cacheType == CACHE_TYPE_UPDATE) {
              mOnCachingUpdateListener.onCachingUpdate(mMediaPlayer, msg.getData().getLongArray(MEDIA_CACHING_SEGMENTS));
            } else if (cacheType == CACHE_TYPE_SPEED) {
              mOnCachingUpdateListener.onCachingSpeed(mMediaPlayer, msg.getData().getInt(MEDIA_CACHING_INFO));
            } else if (cacheType == CACHE_TYPE_START) {
            	mOnCachingUpdateListener.onCachingStart(mMediaPlayer);
            } else if (cacheType == CACHE_TYPE_COMPLETE) {
            	mOnCachingUpdateListener.onCachingComplete(mMediaPlayer);
            }
          }
          return;
        case MEDIA_NOP:
          return;
        case MEDIA_HW_ERROR:
        	if (mOnHWRenderFailedListener != null)
        		mOnHWRenderFailedListener.onFailed();
        	return;
        default:
          Log.e("Unknown message type " + msg.what);
          return;
      }
    }
 
Example 17
Source File: VideoView.java    From MyHearts with Apache License 2.0 4 votes vote down vote up
@Override
public void onTimedText(String text) {
  Log.i("onSubtitleUpdate: %s", text);
  if (mOnTimedTextListener != null)
    mOnTimedTextListener.onTimedText(text);
}
 
Example 18
Source File: VideoView.java    From NetEasyNews with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onTimedTextUpdate(byte[] pixels, int width, int height) {
  Log.i("onSubtitleUpdate: bitmap subtitle, %dx%d", width, height);
  if (mOnTimedTextListener != null)
    mOnTimedTextListener.onTimedTextUpdate(pixels, width, height);
}
 
Example 19
Source File: MediaScanner.java    From MyHearts with Apache License 2.0 4 votes vote down vote up
public void setMimeType(String mimeType) {
  Log.i("setMimeType: %s", mimeType);
  mMimeType = mimeType;
  mFileType = MediaFile.getFileTypeForMimeType(mimeType);
}
 
Example 20
Source File: MediaScanner.java    From MyHearts with Apache License 2.0 4 votes vote down vote up
public void scanFile(String path, long lastModified, long fileSize) {
  Log.i("scanFile: %s", path);
  doScanFile(path, lastModified, fileSize, false);
}