当前位置: 首页>>代码示例>>Java>>正文


Java Format类代码示例

本文整理汇总了Java中com.google.android.exoplayer.chunk.Format的典型用法代码示例。如果您正苦于以下问题:Java Format类的具体用法?Java Format怎么用?Java Format使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Format类属于com.google.android.exoplayer.chunk包,在下文中一共展示了Format类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getMediaMimeType

import com.google.android.exoplayer.chunk.Format; //导入依赖的package包/类
private static String getMediaMimeType(Format format) {
  String formatMimeType = format.mimeType;
  if (MimeTypes.isAudio(formatMimeType)) {
    return MimeTypes.getAudioMediaMimeType(format.codecs);
  } else if (MimeTypes.isVideo(formatMimeType)) {
    return MimeTypes.getVideoMediaMimeType(format.codecs);
  } else if (mimeTypeIsRawText(formatMimeType)) {
    return formatMimeType;
  } else if (MimeTypes.APPLICATION_MP4.equals(formatMimeType)) {
    if ("stpp".equals(format.codecs)) {
      return MimeTypes.APPLICATION_TTML;
    }
    if ("wvtt".equals(format.codecs)) {
      return MimeTypes.APPLICATION_MP4VTT;
    }
  }
  return null;
}
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:19,代码来源:DashChunkSource.java

示例2: adaptiveTrack

import com.google.android.exoplayer.chunk.Format; //导入依赖的package包/类
@Override
public void adaptiveTrack(HlsMasterPlaylist playlist, Variant[] variants) {
  Arrays.sort(variants, new Comparator<Variant>() {
    private final Comparator<Format> formatComparator =
        new Format.DecreasingBandwidthComparator();
    @Override
    public int compare(Variant first, Variant second) {
      return formatComparator.compare(first.format, second.format);
    }
  });

  int defaultVariantIndex = computeDefaultVariantIndex(playlist, variants, bandwidthMeter);
  int maxWidth = -1;
  int maxHeight = -1;

  for (int i = 0; i < variants.length; i++) {
    Format variantFormat = variants[i].format;
    maxWidth = Math.max(variantFormat.width, maxWidth);
    maxHeight = Math.max(variantFormat.height, maxHeight);
  }
  // TODO: We should allow the default values to be passed through the constructor.
  // TODO: Print a warning if resolution tags are omitted.
  maxWidth = maxWidth > 0 ? maxWidth : 1920;
  maxHeight = maxHeight > 0 ? maxHeight : 1080;
  tracks.add(new ExposedTrack(variants, defaultVariantIndex, maxWidth, maxHeight));
}
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:27,代码来源:HlsChunkSource.java

示例3: onDownstreamFormatChanged

import com.google.android.exoplayer.chunk.Format; //导入依赖的package包/类
@Override
public void onDownstreamFormatChanged(int sourceId, Format format, int trigger,
        long mediaTimeMs) {
    if (infoListener == null) {
        return;
    }
    if (sourceId == TYPE_VIDEO) {
        videoFormat = format;
        infoListener.onVideoFormatEnabled(format, trigger, mediaTimeMs);
    } else if (sourceId == TYPE_AUDIO) {
        infoListener.onAudioFormatEnabled(format, trigger, mediaTimeMs);
    }
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:14,代码来源:DemoPlayer.java

示例4: onLoadStarted

import com.google.android.exoplayer.chunk.Format; //导入依赖的package包/类
@Override
public void onLoadStarted(int sourceId, long length, int type, int trigger, Format format,
        long mediaStartTimeMs, long mediaEndTimeMs) {
    if (infoListener != null) {
        infoListener.onLoadStarted(sourceId, length, type, trigger, format, mediaStartTimeMs,
                mediaEndTimeMs);
    }
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:9,代码来源:DemoPlayer.java

示例5: onLoadCompleted

import com.google.android.exoplayer.chunk.Format; //导入依赖的package包/类
@Override
public void onLoadCompleted(int sourceId, long bytesLoaded, int type, int trigger,
        Format format,
        long mediaStartTimeMs, long mediaEndTimeMs, long elapsedRealtimeMs,
        long loadDurationMs) {
    if (infoListener != null) {
        infoListener
                .onLoadCompleted(sourceId, bytesLoaded, type, trigger, format, mediaStartTimeMs,
                        mediaEndTimeMs, elapsedRealtimeMs, loadDurationMs);
    }
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:12,代码来源:DemoPlayer.java

示例6: onDownstreamFormatChanged

import com.google.android.exoplayer.chunk.Format; //导入依赖的package包/类
@Override
public void onDownstreamFormatChanged(int sourceId, Format format, int trigger,
                                      long mediaTimeMs) {
    if (infoListener == null) {
        return;
    }
    if (sourceId == TYPE_VIDEO) {
        videoFormat = format;
        infoListener.onVideoFormatEnabled(format, trigger, mediaTimeMs);
    } else if (sourceId == TYPE_AUDIO) {
        infoListener.onAudioFormatEnabled(format, trigger, mediaTimeMs);
    }
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:14,代码来源:VideoPlayer.java

示例7: onLoadCompleted

import com.google.android.exoplayer.chunk.Format; //导入依赖的package包/类
@Override
public void onLoadCompleted(int sourceId, long bytesLoaded, int type, int trigger,
        Format format,
        long mediaStartTimeMs, long mediaEndTimeMs, long elapsedRealtimeMs,
        long loadDurationMs) {
    if (infoListener != null) {
        infoListener.onLoadCompleted(sourceId, bytesLoaded, type, trigger, format,
                mediaStartTimeMs,
                mediaEndTimeMs, elapsedRealtimeMs, loadDurationMs);
    }
}
 
开发者ID:nejtv,项目名称:androidtv-sample,代码行数:12,代码来源:VideoPlayer.java

示例8: onLoadStarted

import com.google.android.exoplayer.chunk.Format; //导入依赖的package包/类
@Override
public void onLoadStarted(int sourceId, long length, int type, int trigger, Format format,
    long mediaStartTimeMs, long mediaEndTimeMs) {
  loadStartTimeMs[sourceId] = SystemClock.elapsedRealtime();
  if (VerboseLogUtil.isTagEnabled(TAG)) {
    Log.v(TAG, "loadStart [" + getSessionTimeString() + ", " + sourceId + ", " + type
        + ", " + mediaStartTimeMs + ", " + mediaEndTimeMs + "]");
  }
}
 
开发者ID:Dreamxiaoxuan,项目名称:AndroidTvDemo,代码行数:10,代码来源:EventLogger.java

示例9: onLoadCompleted

import com.google.android.exoplayer.chunk.Format; //导入依赖的package包/类
@Override
public void onLoadCompleted(int sourceId, long bytesLoaded, int type, int trigger, Format format,
     long mediaStartTimeMs, long mediaEndTimeMs, long elapsedRealtimeMs, long loadDurationMs) {
  if (VerboseLogUtil.isTagEnabled(TAG)) {
    long downloadTime = SystemClock.elapsedRealtime() - loadStartTimeMs[sourceId];
    Log.v(TAG, "loadEnd [" + getSessionTimeString() + ", " + sourceId + ", " + downloadTime
        + "]");
  }
}
 
开发者ID:Dreamxiaoxuan,项目名称:AndroidTvDemo,代码行数:10,代码来源:EventLogger.java

示例10: onDownstreamFormatChanged

import com.google.android.exoplayer.chunk.Format; //导入依赖的package包/类
@Override
public void onDownstreamFormatChanged(int sourceId, Format format, int trigger,
    long mediaTimeMs) {
  if (infoListener == null) {
    return;
  }
  if (sourceId == TYPE_VIDEO) {
    videoFormat = format;
    infoListener.onVideoFormatEnabled(format, trigger, mediaTimeMs);
  } else if (sourceId == TYPE_AUDIO) {
    infoListener.onAudioFormatEnabled(format, trigger, mediaTimeMs);
  }
}
 
开发者ID:Dreamxiaoxuan,项目名称:AndroidTvDemo,代码行数:14,代码来源:DemoPlayer.java

示例11: onLoadStarted

import com.google.android.exoplayer.chunk.Format; //导入依赖的package包/类
@Override
public void onLoadStarted(int sourceId, long length, int type, int trigger, Format format,
    long mediaStartTimeMs, long mediaEndTimeMs) {
  if (infoListener != null) {
    infoListener.onLoadStarted(sourceId, length, type, trigger, format, mediaStartTimeMs,
        mediaEndTimeMs);
  }
}
 
开发者ID:Dreamxiaoxuan,项目名称:AndroidTvDemo,代码行数:9,代码来源:DemoPlayer.java

示例12: onLoadCompleted

import com.google.android.exoplayer.chunk.Format; //导入依赖的package包/类
@Override
public void onLoadCompleted(int sourceId, long bytesLoaded, int type, int trigger, Format format,
    long mediaStartTimeMs, long mediaEndTimeMs, long elapsedRealtimeMs, long loadDurationMs) {
  if (infoListener != null) {
    infoListener.onLoadCompleted(sourceId, bytesLoaded, type, trigger, format, mediaStartTimeMs,
        mediaEndTimeMs, elapsedRealtimeMs, loadDurationMs);
  }
}
 
开发者ID:Dreamxiaoxuan,项目名称:AndroidTvDemo,代码行数:9,代码来源:DemoPlayer.java

示例13: onLoadStarted

import com.google.android.exoplayer.chunk.Format; //导入依赖的package包/类
@Override
public void onLoadStarted(int sourceId, long length, int type, int trigger, Format format,
                          int mediaStartTimeMs, int mediaEndTimeMs) {
    loadStartTimeMs[sourceId] = SystemClock.elapsedRealtime();
    if (VerboseLogUtil.isTagEnabled(TAG)) {
        Log.v(TAG, "loadStart [" + getSessionTimeString() + ", " + sourceId + ", " + type
                + ", " + mediaStartTimeMs + ", " + mediaEndTimeMs + "]");
    }
}
 
开发者ID:nextux,项目名称:sbs-android-tv,代码行数:10,代码来源:EventLogger.java

示例14: onLoadCompleted

import com.google.android.exoplayer.chunk.Format; //导入依赖的package包/类
@Override
public void onLoadCompleted(int sourceId, long bytesLoaded, int type, int trigger, Format format,
                            long mediaStartTimeMs, long mediaEndTimeMs, long elapsedRealtimeMs, long loadDurationMs) {
    if (infoListener != null) {
        infoListener.onLoadCompleted(sourceId, bytesLoaded, type, trigger, format, mediaStartTimeMs,
                mediaEndTimeMs, elapsedRealtimeMs, loadDurationMs);
    }
}
 
开发者ID:PJakcson,项目名称:Mediathek,代码行数:9,代码来源:Player.java

示例15: onLoadStarted

import com.google.android.exoplayer.chunk.Format; //导入依赖的package包/类
@Override
public void onLoadStarted(int sourceId, long length, int type, int trigger, Format format,
                          long mediaStartTimeMs, long mediaEndTimeMs) {
    if (infoListener != null) {
        infoListener.onLoadStarted(sourceId, length, type, trigger, format, mediaStartTimeMs,
                mediaEndTimeMs);
    }
}
 
开发者ID:MimiReader,项目名称:mimi-reader,代码行数:9,代码来源:ExoPlayerHelper.java


注:本文中的com.google.android.exoplayer.chunk.Format类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。