本文整理汇总了Java中com.google.android.gms.cast.framework.media.RemoteMediaClient.load方法的典型用法代码示例。如果您正苦于以下问题:Java RemoteMediaClient.load方法的具体用法?Java RemoteMediaClient.load怎么用?Java RemoteMediaClient.load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.gms.cast.framework.media.RemoteMediaClient
的用法示例。
在下文中一共展示了RemoteMediaClient.load方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PlayRemote
import com.google.android.gms.cast.framework.media.RemoteMediaClient; //导入方法依赖的package包/类
public static void PlayRemote(String title, String url, String iconurl){
Log.i("CAST",title);
MediaMetadata movieMetadata = new MediaMetadata(MediaMetadata.MEDIA_TYPE_MUSIC_TRACK);
movieMetadata.putString(MediaMetadata.KEY_TITLE, title);
//movieMetadata.putString(MediaMetadata.KEY_SUBTITLE, "MySubTitle");
movieMetadata.addImage(new WebImage(Uri.parse(iconurl)));
//movieMetadata.addImage(new WebImage(Uri.parse(mSelectedMedia.getImage(1))));
MediaInfo mediaInfo = new MediaInfo.Builder(url)
.setStreamType(MediaInfo.STREAM_TYPE_LIVE)
.setContentType("audio/ogg")
.setMetadata(movieMetadata)
//.setStreamDuration(mSelectedMedia.getDuration() * 1000)
.build();
RemoteMediaClient remoteMediaClient = mCastSession.getRemoteMediaClient();
remoteMediaClient.load(mediaInfo, true);
}
示例2: castMedia
import com.google.android.gms.cast.framework.media.RemoteMediaClient; //导入方法依赖的package包/类
private void castMedia() {
if (castSession != null) {
MediaMetadata audioMetadata = new MediaMetadata(MediaMetadata.MEDIA_TYPE_MUSIC_TRACK);
String url = "http://" + Helpers.getIpAddress(MediaRecorderService.this) + ":" + StreamHttpServer.HTTP_SERVER_PORT + StreamHttpServer.HTTP_SERVER_URL_PATH;
MediaInfo mediaInfo = new MediaInfo.Builder(url)
.setStreamType(MediaInfo.STREAM_TYPE_LIVE)
.setContentType("audio/aac")
.setMetadata(audioMetadata)
.build();
Log.d(TAG, "MediaInfo: " + mediaInfo);
RemoteMediaClient remoteMediaClient = castSession.getRemoteMediaClient();
remoteMediaClient.load(mediaInfo);
}
}
示例3: loadRemoteMedia
import com.google.android.gms.cast.framework.media.RemoteMediaClient; //导入方法依赖的package包/类
private void loadRemoteMedia(int position, boolean autoPlay) {
if (mCastSession == null) {
return;
}
final RemoteMediaClient remoteMediaClient = mCastSession.getRemoteMediaClient();
if (remoteMediaClient == null) {
return;
}
remoteMediaClient.addListener(new RemoteMediaClient.Listener() {
@Override
public void onStatusUpdated() {
Intent intent = new Intent(LocalPlayerActivity.this, ExpandedControlsActivity.class);
startActivity(intent);
remoteMediaClient.removeListener(this);
}
@Override
public void onMetadataUpdated() {
}
@Override
public void onQueueStatusUpdated() {
}
@Override
public void onPreloadStatusUpdated() {
}
@Override
public void onSendingRemoteMediaRequest() {
}
});
remoteMediaClient.load(mSelectedMedia, autoPlay, position);
}
示例4: loadRemoteMedia
import com.google.android.gms.cast.framework.media.RemoteMediaClient; //导入方法依赖的package包/类
private void loadRemoteMedia(int position, boolean autoPlay) {
if (mCastSession == null) {
return;
}
final RemoteMediaClient remoteMediaClient = mCastSession.getRemoteMediaClient();
if (remoteMediaClient == null) {
return;
}
remoteMediaClient.addListener(new RemoteMediaClient.Listener() {
@Override
public void onStatusUpdated() {
Intent intent = new Intent(LocalPlayerActivity.this, ExpandedControlsActivity.class);
startActivity(intent);
remoteMediaClient.removeListener(this);
}
@Override
public void onMetadataUpdated() {
}
@Override
public void onQueueStatusUpdated() {
}
@Override
public void onPreloadStatusUpdated() {
}
@Override
public void onSendingRemoteMediaRequest() {
}
@Override
public void onAdBreakStatusUpdated() {
}
});
remoteMediaClient.load(mSelectedMedia, autoPlay, position);
}
示例5: castVideo
import com.google.android.gms.cast.framework.media.RemoteMediaClient; //导入方法依赖的package包/类
private void castVideo(Anime anime, String url){
final RemoteMediaClient mediaClient = castSession.getRemoteMediaClient();
MediaMetadata animeMetadata = new MediaMetadata(MediaMetadata.MEDIA_TYPE_MOVIE);
animeMetadata.putString(MediaMetadata.KEY_TITLE, anime.title);
if(anime.coverURL != null && !anime.coverURL.isEmpty()) {
animeMetadata.addImage(new WebImage(Uri.parse(anime.coverURL)));
}
MediaInfo animeInfo = new MediaInfo.Builder(url)
.setStreamType(MediaInfo.STREAM_TYPE_BUFFERED)
.setContentType("video/mp4")
.setStreamType(MediaInfo.STREAM_TYPE_BUFFERED)
.setMetadata(animeMetadata)
.build();
mediaClient.addListener(new RemoteMediaClient.Listener() {
@Override
public void onStatusUpdated() {
Intent intent = new Intent(AnimeActivity.this, CastActivity.class);
startActivity(intent);
mediaClient.removeListener(this);
finish();
}
@Override
public void onMetadataUpdated() {}
@Override
public void onQueueStatusUpdated() {}
@Override
public void onPreloadStatusUpdated() {}
@Override
public void onSendingRemoteMediaRequest() {}
});
mediaClient.load(animeInfo, true, 0);
}
示例6: loadRemoteMedia
import com.google.android.gms.cast.framework.media.RemoteMediaClient; //导入方法依赖的package包/类
private void loadRemoteMedia(int position, boolean autoPlay) {
if (mCastSession == null) {
return;
}
final RemoteMediaClient remoteMediaClient = mCastSession.getRemoteMediaClient();
if (remoteMediaClient == null) {
return;
}
remoteMediaClient.addListener(new RemoteMediaClient.Listener() {
@Override
public void onStatusUpdated() {
Intent intent = new Intent(LocalPlayerActivity.this, ExpandedControlsActivity.class);
startActivity(intent);
remoteMediaClient.removeListener(this);
}
@Override
public void onMetadataUpdated() {
}
@Override
public void onQueueStatusUpdated() {
}
@Override
public void onPreloadStatusUpdated() {
}
@Override
public void onSendingRemoteMediaRequest() {
}
@Override
public void onAdBreakStatusUpdated() {
}
});
remoteMediaClient.load(buildMediaInfo(), autoPlay, position);
}