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


Java MediaController.setPadding方法代码示例

本文整理汇总了Java中android.widget.MediaController.setPadding方法的典型用法代码示例。如果您正苦于以下问题:Java MediaController.setPadding方法的具体用法?Java MediaController.setPadding怎么用?Java MediaController.setPadding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.MediaController的用法示例。


在下文中一共展示了MediaController.setPadding方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import android.widget.MediaController; //导入方法依赖的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 android.widget.MediaController; //导入方法依赖的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 android.widget.MediaController; //导入方法依赖的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 android.widget.MediaController; //导入方法依赖的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


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