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


Java RemoteMediaClient.load方法代码示例

本文整理汇总了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);
}
 
开发者ID:segler-alex,项目名称:RadioDroid,代码行数:20,代码来源:CastHandler.java

示例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);
    }
}
 
开发者ID:aschober,项目名称:vinyl-cast,代码行数:15,代码来源:MediaRecorderService.java

示例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);
}
 
开发者ID:nordfalk,项目名称:EsperantoRadio,代码行数:35,代码来源:LocalPlayerActivity.java

示例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);
}
 
开发者ID:googlecast,项目名称:CastVideos-android,代码行数:39,代码来源:LocalPlayerActivity.java

示例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);
}
 
开发者ID:daose,项目名称:KSAnime,代码行数:34,代码来源:AnimeActivity.java

示例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);
}
 
开发者ID:googlecodelabs,项目名称:cast-videos-android,代码行数:40,代码来源:LocalPlayerActivity.java


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