本文整理汇总了Java中org.videolan.vlc.MediaWrapper.getWidth方法的典型用法代码示例。如果您正苦于以下问题:Java MediaWrapper.getWidth方法的具体用法?Java MediaWrapper.getWidth怎么用?Java MediaWrapper.getWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.videolan.vlc.MediaWrapper
的用法示例。
在下文中一共展示了MediaWrapper.getWidth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fillVideoView
import org.videolan.vlc.MediaWrapper; //导入方法依赖的package包/类
private void fillVideoView(ViewHolder holder, MediaWrapper media) {
/* Time / Duration */
if (media.getLength() > 0) {
long lastTime = media.getTime();
String text;
if (lastTime > 0) {
text = String.format("%s / %s",
Strings.millisToText(lastTime),
Strings.millisToText(media.getLength()));
holder.progress.setVisibility(View.VISIBLE);
holder.progress.setMax((int) (media.getLength() / 1000));
holder.progress.setProgress((int) (lastTime / 1000));
} else {
text = Strings.millisToText(media.getLength());
holder.progress.setVisibility(View.INVISIBLE);
}
holder.time.setText(text);
} else
holder.progress.setVisibility(View.INVISIBLE);
if (media.getWidth() > 0 && media.getHeight() > 0)
holder.resolution.setText(String.format("%dx%d", media.getWidth(), media.getHeight()));
else
holder.resolution.setText("");
holder.title.setText(media.getTitle());
holder.more.setVisibility(View.VISIBLE);
}
示例2: fillView
import org.videolan.vlc.MediaWrapper; //导入方法依赖的package包/类
private void fillView(ViewHolder holder, MediaWrapper media) {
boolean group;
String text = "";
String resolution = "";
int max = 0;
int progress = 0;
if (media.getType() == MediaWrapper.TYPE_GROUP) {
group = true;
MediaGroup mediaGroup = (MediaGroup) media;
int size = mediaGroup.size();
resolution = getContext().getResources().getQuantityString(R.plurals.videos_quantity, size, size);
} else {
group = false;
/* Time / Duration */
if (media.getLength() > 0) {
long lastTime = media.getTime();
if (lastTime > 0) {
text = String.format("%s / %s",
Strings.millisToText(lastTime),
Strings.millisToText(media.getLength()));
max = (int) (media.getLength() / 1000);
progress = (int) (lastTime / 1000);
} else {
text = Strings.millisToText(media.getLength());
}
}
if (media.getWidth() > 0 && media.getHeight() > 0)
resolution = String.format("%dx%d", media.getWidth(), media.getHeight());
}
holder.binding.setVariable(BR.group, group);
holder.binding.setVariable(BR.resolution, resolution);
holder.binding.setVariable(BR.time, text);
holder.binding.setVariable(BR.max, max);
holder.binding.setVariable(BR.progress, progress);
}