/** * Set the enabled state of the video track * * @param enabled */ public void setVideoTrackEnabled(boolean enabled) { if (!enabled) { setVideoTrack(-1); } else if (getVideoTrack() == -1) { final MediaPlayer.TrackDescription tracks[] = getVideoTracks(); if (tracks != null) { for (MediaPlayer.TrackDescription track : tracks) { if (track.id != -1) { setVideoTrack(track.id); break; } } } } }
/** * Get the current video track */ public Media.VideoTrack getCurrentVideoTrack() { if (getVideoTrack() == -1) return null; final int trackCount = mMedia.getTrackCount(); for (int i = 0; i < trackCount; ++i) { final Media.Track track = mMedia.getTrack(i); if (track.type == Media.Track.Type.Video) return (Media.VideoTrack) track; } return null; }
/** * Set the enabled state of the video track * * @param enabled */ public void setVideoTrackEnabled(boolean enabled) { if (!enabled) { setVideoTrack(-1); } else if (getVideoTrack() == -1) { final MediaPlayer.TrackDescription tracks[] = getVideoTracks(); if (tracks != null) { for (MediaPlayer.TrackDescription track : tracks) { if (track.id != -1) { setVideoTrack(track.id); break; } } } } }
/** * Get the current video track */ public Media.VideoTrack getCurrentVideoTrack() { if (getVideoTrack() == -1) return null; final int trackCount = mMedia.getTrackCount(); for (int i = 0; i < trackCount; ++i) { final Media.Track track = mMedia.getTrack(i); if (track.type == Media.Track.Type.Video) return (Media.VideoTrack) track; } return null; }
/** * Set the enabled state of the video track * * @param enabled */ public void setVideoTrackEnabled(boolean enabled) { if (!enabled) { setVideoTrack(-1); } else if (getVideoTrack() == -1) { final TrackDescription tracks[] = getVideoTracks(); if (tracks != null) { for (TrackDescription track : tracks) { if (track.id != -1) { setVideoTrack(track.id); break; } } } } }
/** * Get the current video track */ public Media.VideoTrack getCurrentVideoTrack() { if (getVideoTrack() == -1) return null; final int trackCount = mMedia.getTrackCount(); for (int i = 0; i < trackCount; ++i) { final Media.Track track = mMedia.getTrack(i); if (track.type == Media.Track.Type.Video) return (Media.VideoTrack) track; } return null; }
/** * Set the enabled state of the video track * * @param enabled */ public void setVideoTrackEnabled(boolean enabled) { if (!enabled) { setVideoTrack(-1); } else if (getVideoTrack() == -1) { final MediaPlayer.TrackDescription tracks[] = getVideoTracks(); if (tracks != null) { for (MediaPlayer.TrackDescription track : tracks) { if (track.id != -1) { setVideoTrack(track.id); /* HACK: flush when activating a video track. This will force an * I-Frame to be displayed right away. */ if (isSeekable()) { long time = getTime(); if (time > 0) setTime(time); } break; } } } } }
/** * Set the enabled state of the video track * * @param enabled */ public void setVideoTrackEnabled(boolean enabled) { if (!enabled) { setVideoTrack(-1); } else if (getVideoTrack() == -1) { final TrackDescription tracks[] = getVideoTracks(); if (tracks != null) { for (TrackDescription track : tracks) { if (track.id != -1) { setVideoTrack(track.id); /* HACK: flush when activating a video track. This will force an * I-Frame to be displayed right away. */ if (isSeekable()) { long time = getTime(); if (time > 0) setTime(time); } break; } } } } }