本文整理汇总了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();
}
示例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();
}
示例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++;
}