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


Java AudioCapabilitiesReceiver类代码示例

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


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

示例1: onCreate

import com.google.android.exoplayer.audio.AudioCapabilitiesReceiver; //导入依赖的package包/类
@Override
public void onCreate() {
    TvApplication.setCurrentRunningProcess(this, false);
    super.onCreate();
    if (DEBUG) Log.d(TAG, "onCreate");
    mChannelDataManager = new ChannelDataManager(getApplicationContext());
    mAudioCapabilitiesReceiver = new AudioCapabilitiesReceiver(getApplicationContext(), this);
    mAudioCapabilitiesReceiver.register();
    mBufferManager = createBufferManager();
    if (CommonFeatures.DVR.isEnabled(this)) {
        JobScheduler jobScheduler =
                (JobScheduler) getSystemService(Context.JOB_SCHEDULER_SERVICE);
        JobInfo pendingJob = jobScheduler.getPendingJob(DVR_STORAGE_CLEANUP_JOB_ID);
        if (pendingJob != null) {
            // storage cleaning job is already scheduled.
        } else {
            JobInfo job = new JobInfo.Builder(DVR_STORAGE_CLEANUP_JOB_ID,
                    new ComponentName(this, TunerStorageCleanUpService.class))
                    .setPersisted(true).setPeriodic(TimeUnit.DAYS.toMillis(1)).build();
            jobScheduler.schedule(job);
        }
    }
    if (mBufferManager == null) {
        Log.i(TAG, "Trickplay is disabled");
    } else {
        Log.i(TAG, "Trickplay is enabled");
    }
}
 
开发者ID:trevd,项目名称:android_packages_apps_tv,代码行数:29,代码来源:TunerTvInputService.java

示例2: onCreate

import com.google.android.exoplayer.audio.AudioCapabilitiesReceiver; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    EpisodeBaseModel episode = (EpisodeBaseModel) getIntent().getSerializableExtra(ContentManagerBase.CONTENT_ID);
    mOtherEpisodeUrls = Arrays.asList(getIntent().getStringArrayExtra(ContentManagerBase.OTHER_EPISODES));
    resumePosition = getIntent().getLongExtra(RESUME_POSITION, 0);

    if (resumePosition <= 0 && episode.getResumePosition() > 0) {
        resumePosition = episode.getResumePosition();
        Log.d(TAG, "Resume from recently played");
    }

    setContentView(R.layout.video_player_activity);
    View root = findViewById(R.id.root);

    mediaController = new PlaybackControls(this);
    mediaController.setAnchorView(root);
    videoPlayerView = new VideoPlayerView(this, mediaController, root);

    audioCapabilitiesReceiver = new AudioCapabilitiesReceiver(getApplicationContext(), this);

    CookieHandler currentHandler = CookieHandler.getDefault();
    if (currentHandler != defaultCookieManager) {
        CookieHandler.setDefault(defaultCookieManager);
    }

    playEpisode(episode);
}
 
开发者ID:nextux,项目名称:sbs-android-tv,代码行数:29,代码来源:VideoPlayerActivity.java

示例3: onCreate

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

    setContentView(R.layout.activity_video_player);
    View root = findViewById(R.id.root);
    root.setOnTouchListener((view, motionEvent) -> {
        if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
            toggleControlsVisibility();
        } else if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
            view.performClick();
        }
        return true;
    });
    root.setOnKeyListener((v, keyCode, event) -> !(keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_ESCAPE
            || keyCode == KeyEvent.KEYCODE_MENU) && mediaController.dispatchKeyEvent(event));

    shutterView = findViewById(R.id.shutter);

    videoFrame = (AspectRatioFrameLayout) findViewById(R.id.video_frame);
    surfaceView = (SurfaceView) findViewById(R.id.surface_view);
    surfaceView.getHolder().addCallback(this);

    subtitleLayout = (SubtitleLayout) findViewById(R.id.subtitles);

    mediaController = new KeyCompatibleMediaController(this);
    mediaController.setAnchorView(root);

    CookieHandler currentHandler = CookieHandler.getDefault();
    if (currentHandler != defaultCookieManager) {
        CookieHandler.setDefault(defaultCookieManager);
    }

    audioCapabilitiesReceiver = new AudioCapabilitiesReceiver(this, this);
    audioCapabilitiesReceiver.register();
}
 
开发者ID:konifar,项目名称:droidkaigi2016,代码行数:37,代码来源:VideoPlayerActivity.java

示例4: replaceRenderBuilder

import com.google.android.exoplayer.audio.AudioCapabilitiesReceiver; //导入依赖的package包/类
public void replaceRenderBuilder(@Nullable RenderBuilder renderBuilder) {
    this.rendererBuilder = renderBuilder;
    if (rendererBuilder != null && audioCapabilities == null) {
        audioCapabilitiesReceiver = new AudioCapabilitiesReceiver(rendererBuilder.getContext(), this);
        audioCapabilitiesReceiver.register();
    }

    prepared = false;
    prepare();
}
 
开发者ID:ayaseruri,项目名称:luxunPro,代码行数:11,代码来源:EMExoPlayer.java

示例5: setup

import com.google.android.exoplayer.audio.AudioCapabilitiesReceiver; //导入依赖的package包/类
protected void setup() {
    audioCapabilitiesReceiver = new AudioCapabilitiesReceiver(getContext().getApplicationContext(), this);
    audioCapabilitiesReceiver.register();
    emExoPlayer = new EMExoPlayer(null);

    //Sets the internal listener
    emExoPlayer.setMetadataListener(null);
    setSurfaceTextureListener(new EMExoVideoSurfaceTextureListener());

    updateVideoSize(0, 0);
}
 
开发者ID:ayaseruri,项目名称:luxunPro,代码行数:12,代码来源:ExoVideoView.java

示例6: initExoPlayer

import com.google.android.exoplayer.audio.AudioCapabilitiesReceiver; //导入依赖的package包/类
/**
 * 初始化播放器
 */
private void initExoPlayer() {
    audioCapabilitiesReceiver = new AudioCapabilitiesReceiver(getContext().getApplicationContext(), this);
    audioCapabilitiesReceiver.register();
    okPlayer = new OkPlayer(null);

    okPlayer.addListener(this);
    okPlayer.setId3MetadataListener(null);

    okPlayer.setSurface(surfaceView.getHolder().getSurface());
    surfaceView.getHolder().addCallback(this);
}
 
开发者ID:succlz123,项目名称:OkPlayer,代码行数:15,代码来源:OkVideoView.java

示例7: onCreate

import com.google.android.exoplayer.audio.AudioCapabilitiesReceiver; //导入依赖的package包/类
@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
// TODO:
//		setContentView(R.layout.player_activity);
		setContentView(R.layout.player_activity_two);
		root = findViewById(R.id.root);
		root.setOnTouchListener(new OnTouchListener() {
			@Override
			public boolean onTouch(View view, MotionEvent motionEvent) {
				if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
					toggleControlsVisibility();
				} else if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
					view.performClick();
				}
				return true;
			}
		});
		root.setOnKeyListener(new OnKeyListener() {
			@Override
			public boolean onKey(View v, int keyCode, KeyEvent event) {
				if (keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_ESCAPE
						|| keyCode == KeyEvent.KEYCODE_MENU) {
					return false;
				}
				// TODO: return mediaController.dispatchKeyEvent(event);
				return goatMediaController.dispatchKeyEvent(event);
			}
		});

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

		videoFrame = (AspectRatioFrameLayout) findViewById(R.id.video_frame);
		surfaceView = (SurfaceView) 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);
		subtitleLayout = (SubtitleLayout) findViewById(R.id.subtitles);
		// TODO:
		// mediaController = new MediaController(this);
		// mediaController.setAnchorView(root);
		goatMediaController = (GoatMediaController) findViewById(R.id.media_controller);
		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);

		CookieHandler currentHandler = CookieHandler.getDefault();
		if (currentHandler != defaultCookieManager) {
			CookieHandler.setDefault(defaultCookieManager);
		}

		audioCapabilitiesReceiver = new AudioCapabilitiesReceiver(this, this);
		audioCapabilitiesReceiver.register();
		
		getWindow().getDecorView().setOnSystemUiVisibilityChangeListener(this);
	}
 
开发者ID:vuthanhict,项目名称:ExoPlayerController,代码行数:61,代码来源:PlayerActivity.java

示例8: onCreate

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

    setContentView(R.layout.player_activity);
    View root = findViewById(R.id.root);
    root.setOnTouchListener(new OnTouchListener() {
        @Override
        public boolean onTouch(View view, MotionEvent motionEvent) {
            if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
                toggleControlsVisibility();
            } else if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
                view.performClick();
            }
            return true;
        }
    });
    root.setOnKeyListener(new OnKeyListener() {
        @Override
        public boolean onKey(View v, int keyCode, KeyEvent event) {
            if (keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_ESCAPE
                    || keyCode == KeyEvent.KEYCODE_MENU) {
                return false;
            }
            return mediaController.dispatchKeyEvent(event);
        }
    });

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

    videoFrame = (AspectRatioFrameLayout) findViewById(R.id.video_frame);
    surfaceView = (SurfaceView) 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);
    subtitleLayout = (SubtitleLayout) findViewById(R.id.subtitles);

    mediaController = new KeyCompatibleMediaController(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);

    CookieHandler currentHandler = CookieHandler.getDefault();
    if (currentHandler != defaultCookieManager) {
        CookieHandler.setDefault(defaultCookieManager);
    }

    audioCapabilitiesReceiver = new AudioCapabilitiesReceiver(this, this);
    audioCapabilitiesReceiver.register();
}
 
开发者ID:asifkhan11,项目名称:ExoPlayer-Demo,代码行数:56,代码来源:PlayerActivity.java

示例9: bindView

import com.google.android.exoplayer.audio.AudioCapabilitiesReceiver; //导入依赖的package包/类
private void bindView(FrameLayout oldRoot) {
    @SuppressLint("InflateParams")
    ViewGroup root = (ViewGroup) activity.getLayoutInflater().inflate(R.layout.player_view_layout, null);
    ViewGroupUtils.replaceView(oldRoot, root);

    root.setOnTouchListener(new View.OnTouchListener() {
        @Override
        public boolean onTouch(View view, MotionEvent motionEvent) {
            if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
                toggleControlsVisibility();
            } else if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
                view.performClick();
            }
            return true;
        }
    });
    root.setOnKeyListener(new View.OnKeyListener() {
        @Override
        public boolean onKey(View v, int keyCode, KeyEvent event) {
            if (keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_MENU) {
                return false;
            }
            return mediaController.dispatchKeyEvent(event);
        }
    });

    audioCapabilitiesReceiver = new AudioCapabilitiesReceiver(activity.getApplicationContext(),
            this);

    shutterView = root.findViewById(R.id.shutter);

    videoFrame = (AspectRatioFrameLayout) root.findViewById(R.id.video_frame);
    surfaceView = (SurfaceView) root.findViewById(R.id.surface_view);
    surfaceView.getHolder().addCallback(this);

    subtitleLayout = (SubtitleLayout) root.findViewById(R.id.subtitles);

    mediaController = new VideoControllerView(activity, false);
    mediaController.setAnchorView(root);


    CookieHandler currentHandler = CookieHandler.getDefault();
    if (currentHandler != defaultCookieManager) {
        CookieHandler.setDefault(defaultCookieManager);
    }

}
 
开发者ID:cklar,项目名称:ExoPlayerWrapper,代码行数:48,代码来源:SimpleVideoPlayer.java

示例10: onCreate

import com.google.android.exoplayer.audio.AudioCapabilitiesReceiver; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mAudioCapabilitiesReceiver = new AudioCapabilitiesReceiver(getActivity(), mAudioCapabilitiesListener);
}
 
开发者ID:caspercba,项目名称:exoPlayerHLS,代码行数:6,代码来源:ExoPlayerFragment.java


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