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


Java ContentMetadata类代码示例

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


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

示例1: onCreate

import com.google.cast.ContentMetadata; //导入依赖的package包/类
/**
 * Initializes MediaRouter information and prepares for Cast device detection upon creating
 * this activity.
 */
@Override
protected void onCreate(Bundle savedInstanceState) {
    logVIfEnabled(TAG, "onCreate called");
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_cast_sample);

    mCastContext = new CastContext(getApplicationContext());
    mMedia = new CastMedia(null, null);
    mMetaData = new ContentMetadata();

    mDialogFactory = new SampleMediaRouteDialogFactory();

    MediaRouteHelper.registerMinimalMediaRouteProvider(mCastContext, this);
    mMediaRouter = MediaRouter.getInstance(getApplicationContext());
    mMediaRouteSelector = MediaRouteHelper
            .buildMediaRouteSelector(MediaRouteHelper.CATEGORY_CAST);

    mMediaRouteButton = (MediaRouteButton) findViewById(R.id.media_route_button);
    mMediaRouteButton.setRouteSelector(mMediaRouteSelector);
    mMediaRouteButton.setDialogFactory(mDialogFactory);
    mMediaRouterCallback = new MyMediaRouterCallback();

    mStatusText = (TextView) findViewById(R.id.play_status_text);
    mCurrentlyPlaying = (TextView) findViewById(R.id.currently_playing);
    mCurrentlyPlaying.setText(getString(R.string.tap_to_select));
    mMediaSelectionDialog = new MediaSelectionDialog(this);

    mPlayPauseButton = (ImageButton) findViewById(R.id.play_pause_button);
    mStopButton = (ImageButton) findViewById(R.id.stop_button);
    initButtons();

    Thread myThread = null;
    Runnable runnable = new StatusRunner();
    myThread = new Thread(runnable);
    logVIfEnabled(TAG, "Starting statusRunner thread");
    myThread.start();
}
 
开发者ID:Cameronjmayfield,项目名称:cast-android-sample,代码行数:42,代码来源:CastSampleActivity.java

示例2: onCreate

import com.google.cast.ContentMetadata; //导入依赖的package包/类
/**
 * Initializes MediaRouter information and prepares for Cast device detection upon creating
 * this activity.
 */
@Override
protected void onCreate(Bundle savedInstanceState) {
    logVIfEnabled(TAG, "onCreate called");
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_cast_sample);

    mCastContext = new CastContext(getApplicationContext());
    mMedia = new CastMedia(null, null);
    mMetaData = new ContentMetadata();

    mDialogFactory = new SampleMediaRouteDialogFactory();

    MediaRouteHelper.registerMinimalMediaRouteProvider(mCastContext, this);
    mMediaRouter = MediaRouter.getInstance(getApplicationContext());
    mMediaRouteSelector = MediaRouteHelper
            .buildMediaRouteSelector(MediaRouteHelper.CATEGORY_CAST,
                    getResources().getString(R.string.app_name), null);

    mMediaRouteButton = (MediaRouteButton) findViewById(R.id.media_route_button);
    mMediaRouteButton.setRouteSelector(mMediaRouteSelector);
    mMediaRouteButton.setDialogFactory(mDialogFactory);
    mMediaRouterCallback = new MyMediaRouterCallback();

    mStatusText = (TextView) findViewById(R.id.play_status_text);
    mCurrentlyPlaying = (TextView) findViewById(R.id.currently_playing);
    mCurrentlyPlaying.setText(getString(R.string.tap_to_select));
    mMediaSelectionDialog = new MediaSelectionDialog(this);

    mPlayPauseButton = (ImageButton) findViewById(R.id.play_pause_button);
    mStopButton = (ImageButton) findViewById(R.id.stop_button);
    initButtons();

    Thread myThread = null;
    Runnable runnable = new StatusRunner();
    myThread = new Thread(runnable);
    logVIfEnabled(TAG, "Starting statusRunner thread");
    myThread.start();
}
 
开发者ID:johnjohndoe,项目名称:cast-android-sample-android-studio,代码行数:43,代码来源:CastSampleActivity.java

示例3: onCreate

import com.google.cast.ContentMetadata; //导入依赖的package包/类
/**
 * Initializes MediaRouter information and prepares for Cast device
 * detection upon creating this activity.
 */
@Override
protected void onCreate(Bundle savedInstanceState) {
    logVIfEnabled(TAG, "onCreate called");
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_cast);

    mCastContext = new CastContext(getApplicationContext());
    mMedia = new CastMedia(null, null);
    mMetaData = new ContentMetadata();

    mDialogFactory = new SampleMediaRouteDialogFactory();

    MediaRouteHelper.registerMinimalMediaRouteProvider(mCastContext, this);
    mMediaRouter = MediaRouter.getInstance(getApplicationContext());
    mMediaRouteSelector = MediaRouteHelper
            .buildMediaRouteSelector(MediaRouteHelper.CATEGORY_CAST);

    mMediaRouteButton = (MediaRouteButton) findViewById(R.id.media_route_button);
    mMediaRouteButton.setRouteSelector(mMediaRouteSelector);
    mMediaRouteButton.setDialogFactory(mDialogFactory);
    mMediaRouterCallback = new MyMediaRouterCallback();

    mStatusText = (TextView) findViewById(R.id.play_status_text);
    mCurrentlyPlaying = (TextView) findViewById(R.id.currently_playing);
    mCurrentlyPlaying.setText(getString(R.string.tap_to_select));

    mPlayPauseButton = (ImageButton) findViewById(R.id.play_pause_button);
    mStopButton = (ImageButton) findViewById(R.id.stop_button);
    initButtons();

    myThread = null;
    Runnable runnable = new StatusRunner();
    myThread = new Thread(runnable);
    logVIfEnabled(TAG, "Starting statusRunner thread");
    myThread.start();

    Intent intent = getIntent();
    String url = intent.getStringExtra("MEDIA_URL");
    urls = intent.getStringArrayListExtra("MEDIA_URL_LIST");
    if (urls == null || urls.size() == 0) {
        urls = new ArrayList<String>();
        urls.add(url);
    }
    title = intent.getStringExtra("MEDIA_TITLE");

    if (title == null || title.isEmpty())
        title = urls.get(0);

    this.mediaSelected(new CastMedia(title, urls.get(0)));
    nextUrl++;
}
 
开发者ID:qiushengxy,项目名称:cast-any,代码行数:56,代码来源:CastActivity.java


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