• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java VideoSurfaceView类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: onCreate

import com.google.android.exoplayer.VideoSurfaceView; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_player);

    mVideo = (Video)getIntent().getSerializableExtra(Video.INTENT_EXTRA_VIDEO);

    View root = findViewById(R.id.root);
    mediaController = new MediaController(this);

    //overscan safe on 1980 * 1080 TV
    mediaController.setPadding(48, 27, 48, 27);
    mediaController.setAnchorView(root);
    shutterView = findViewById(R.id.shutter);
    surfaceView = (VideoSurfaceView) findViewById(R.id.surface_view);
    surfaceView.getHolder().addCallback(this);

    preparePlayer();
}
 
开发者ID:googlecodelabs,项目名称:android-tv-leanback,代码行数:20,代码来源:PlayerActivity.java


示例2: onCreate

import com.google.android.exoplayer.VideoSurfaceView; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_player);

    mVideo = (Video) getIntent().getSerializableExtra(Video.INTENT_EXTRA_VIDEO);

    View root = findViewById(R.id.root);
    mediaController = new MediaController(this);

    //overscan safe on 1980 * 1080 TV
    mediaController.setPadding(48, 27, 48, 27);
    mediaController.setAnchorView(root);
    shutterView = findViewById(R.id.shutter);
    surfaceView = (VideoSurfaceView) findViewById(R.id.surface_view);
    surfaceView.getHolder().addCallback(this);

    preparePlayer();
}
 
开发者ID:googlecodelabs,项目名称:android-tv-leanback,代码行数:20,代码来源:PlayerActivity.java


示例3: onCreate

import com.google.android.exoplayer.VideoSurfaceView; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Log.d(TAG, "onCreate()");
    setContentView(R.layout.activity_player);

    mVideo = (Video) getIntent().getSerializableExtra(Video.INTENT_EXTRA_VIDEO);

    // We will use the PlaybackOverlayFragment when running on TV.
    mIsOnTv = MyUtil.isRunningInTvMode(this);
    if (mIsOnTv) {
        // On TV we will use the resource in layout-televsion
        mPlaybackOverlayFragment = (PlaybackOverlayFragment)
                getFragmentManager().findFragmentById(R.id.playback_controls_fragment);
    } else {
        shutterView = findViewById(R.id.shutter);
        View root = findViewById(R.id.root);
        mediaController = new MediaController(this);

        //overscan safe on 1980 * 1080 TV
        mediaController.setPadding(48, 27, 48, 27);
        mediaController.setAnchorView(root);
    }
    surfaceView = (VideoSurfaceView) findViewById(R.id.surface_view);
    surfaceView.getHolder().addCallback(this);

    preparePlayer();
}
 
开发者ID:googlecodelabs,项目名称:android-tv-leanback,代码行数:29,代码来源:PlayerActivity.java


示例4: onCreate

import com.google.android.exoplayer.VideoSurfaceView; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_player);

    View root = findViewById(R.id.root);
    mediaController = new MediaController(this);

    //overscan safe on 1980 * 1080 TV
    mediaController.setPadding(48, 27, 48, 27);
    mediaController.setAnchorView(root);
    shutterView = findViewById(R.id.shutter);
    surfaceView = (VideoSurfaceView) findViewById(R.id.surface_view);
    surfaceView.getHolder().addCallback(this);

    SampleSource sampleSource =
            new FrameworkSampleSource(this, Uri.parse(url), /* headers */ null, RENDERER_COUNT);

    // Build the track renderers
    videoRenderer = new MediaCodecVideoTrackRenderer(sampleSource, MediaCodec.VIDEO_SCALING_MODE_SCALE_TO_FIT);
    TrackRenderer audioRenderer = new MediaCodecAudioTrackRenderer(sampleSource);

    // Setup the player
    player = ExoPlayer.Factory.newInstance(RENDERER_COUNT, 1000, 5000);
    player.addListener(this);
    // Build the player controls
    mediaController.setMediaPlayer(new PlayerControl(player));
    mediaController.setEnabled(true);
    player.prepare(videoRenderer, audioRenderer);
}
 
开发者ID:googlecodelabs,项目名称:android-tv-leanback,代码行数:31,代码来源:PlayerActivity.java


示例5: onCreate

import com.google.android.exoplayer.VideoSurfaceView; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  Intent intent = getIntent();
  contentUri = intent.getData();
  contentType = intent.getIntExtra(DemoUtil.CONTENT_TYPE_EXTRA, DemoUtil.TYPE_OTHER);
  contentId = intent.getStringExtra(DemoUtil.CONTENT_ID_EXTRA);

  mainHandler = new Handler(getMainLooper());
  builder = getRendererBuilder();

  setContentView(R.layout.player_activity_simple);
  View root = findViewById(R.id.root);
  root.setOnTouchListener(new OnTouchListener() {
    @Override
    public boolean onTouch(View arg0, MotionEvent arg1) {
      if (arg1.getAction() == MotionEvent.ACTION_DOWN) {
        toggleControlsVisibility();
      }
      return true;
    }
  });

  mediaController = new MediaController(this);
  mediaController.setAnchorView(root);
  shutterView = findViewById(R.id.shutter);
  surfaceView = (VideoSurfaceView) findViewById(R.id.surface_view);
  surfaceView.getHolder().addCallback(this);

  DemoUtil.setDefaultCookieManager();
}
 
开发者ID:Weco,项目名称:android-exoplayer,代码行数:33,代码来源:SimplePlayerActivity.java


示例6: onVideoSizeChanged

import com.google.android.exoplayer.VideoSurfaceView; //导入依赖的package包/类
@Override
public void onVideoSizeChanged(int width, int height, float pixelWidthAspectRatio) {
  shutterView.setVisibility(View.GONE);
  if(surfaceView instanceof com.google.android.exoplayer.VideoSurfaceView)
 ((com.google.android.exoplayer.VideoSurfaceView) surfaceView).setVideoWidthHeightRatio(
      height == 0 ? 1 : (width * pixelWidthAspectRatio) / height);
}
 
开发者ID:tyazid,项目名称:Exoplayer_VLC,代码行数:8,代码来源:PlayerActivity.java


示例7: onCreate

import com.google.android.exoplayer.VideoSurfaceView; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mainHandler = new Handler(getMainLooper());
    builder = getRendererBuilder();

    setContentView(R.layout.activity_player_demo);
    ViewGroup root = (ViewGroup) findViewById(R.id.root);
    root.setOnTouchListener(new OnTouchListener() {
        @Override
        public boolean onTouch(View arg0, MotionEvent arg1) {
            if (arg1.getAction() == MotionEvent.ACTION_DOWN) {
                toggleControlsVisibility();
            }
            arg0.performClick();
            return true;
        }
        
    });

    mediaController = new EPlayerController(this);
    mediaController.setAnchorView(root);
    shutterView = findViewById(R.id.shutter);
    surfaceView = (VideoSurfaceView) findViewById(R.id.surface_view);
    surfaceView.getHolder().addCallback(this);
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:28,代码来源:PlayerDemoActivity.java


示例8: onCreate

import com.google.android.exoplayer.VideoSurfaceView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    surface_view = (VideoSurfaceView)findViewById(R.id.surface_view);
    surface_view.getHolder().addCallback(this);
}
 
开发者ID:lsjwzh,项目名称:ExoPlayerCompat,代码行数:8,代码来源:MainActivity.java


示例9: onCreate

import com.google.android.exoplayer.VideoSurfaceView; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  Intent intent = getIntent();
  contentUri = intent.getData();
  contentType = intent.getIntExtra(DemoUtil.CONTENT_TYPE_EXTRA, DemoUtil.TYPE_OTHER);
  contentId = intent.getStringExtra(DemoUtil.CONTENT_ID_EXTRA);

  setContentView(R.layout.player_activity_full);
  View root = findViewById(R.id.root);
  root.setOnTouchListener(new OnTouchListener() {
    @Override
    public boolean onTouch(View arg0, MotionEvent arg1) {
      if (arg1.getAction() == MotionEvent.ACTION_DOWN) {
        toggleControlsVisibility();
      }
      return true;
    }
  });

  shutterView = findViewById(R.id.shutter);
  debugRootView = findViewById(R.id.controls_root);

  surfaceView = (VideoSurfaceView) findViewById(R.id.surface_view);
  surfaceView.getHolder().addCallback(this);
  debugTextView = (TextView) findViewById(R.id.debug_text_view);

  playerStateTextView = (TextView) findViewById(R.id.player_state_view);
  subtitleView = (SubtitleView) findViewById(R.id.subtitles);

  mediaController = new MediaController(this);
  mediaController.setAnchorView(root);
  retryButton = (Button) findViewById(R.id.retry_button);
  retryButton.setOnClickListener(this);
  videoButton = (Button) findViewById(R.id.video_controls);
  audioButton = (Button) findViewById(R.id.audio_controls);
  textButton = (Button) findViewById(R.id.text_controls);

  DemoUtil.setDefaultCookieManager();
}
 
开发者ID:Weco,项目名称:android-exoplayer,代码行数:42,代码来源:FullPlayerActivity.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ExtDirectMethod类代码示例发布时间:2022-05-22
下一篇:
Java RewriteRuleTokenStream类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap