Cast Companion Library MediaInfo构建器

时间:2014-08-27 22:34:07

标签: google-cast

我正在努力让Cast Companion Libary工作。连接到我的chromecast时出现此错误:

V1.8无法获取播放和媒体信息 java.util.Arrays.hashCode(Arrays.java:1261)中com.google.android.gms.cast.MediaMetadata.hasCode(未知来源)的java.lang.NullPointerException

这是我的MediaMetadata代码:

//CCL
mCastManager = CastApplication.getCastManager(this);
setupCastListener();
String uriString = "https://drive.google.com/file/d/0B_gd0dkW0YA7bjYxZVoxTXZOSEU/edit?usp=sharing";
//mSelectedMedia = com.google.sample.castcompanionlibrary.utils.Utils.toMediaInfo(getIntent().getBundleExtra("media"));
MediaMetadata mediaMetadata = new MediaMetadata(MediaMetadata.MEDIA_TYPE_MUSIC_TRACK);
mediaMetadata.putString(MediaMetadata.KEY_ALBUM_TITLE, "Mouseworld Radio JB");
mediaMetadata.putString(MediaMetadata.KEY_STUDIO, "Mike Newell");
mediaMetadata.putString(MediaMetadata.KEY_SUBTITLE, "subtitle");
mediaMetadata.addImage(new WebImage(Uri.parse(uriString)));
mSelectedMedia = new MediaInfo.Builder(Play.selectedUrl)
    .setContentType("audio/mpeg")
    .setStreamType(MediaInfo.STREAM_TYPE_LIVE)
    .setMetadata(mediaMetadata).build();

以下是日志信息:

09-02 09:11:06.805: D/CastMediaRouteProvider(1109): buildRouteDescriptorForDevice: id=98cf19fa4873c9345143b46a51ee6998, description=Living Room, connecting=false, volume=20
09-02 09:11:06.805: D/CastMediaRouteProvider(1109): published 1 routes
09-02 09:11:06.805: D/ccl_VideoCastNotificat(25015): [v1.8] onStartCommand
09-02 09:11:06.805: D/ccl_VideoCastNotificat(25015): [v1.8] onStartCommand(): Action: none
09-02 09:11:06.805: D/ccl_VideoCastManager(25015): [v1.8] onApplicationStatusChanged() reached: Ready To Cast
09-02 09:11:06.805: D/ccl_BaseCastManager(25015): [v1.8] UI is visible
09-02 09:11:06.805: D/ccl_BaseCastManager(25015): [v1.8] Successfully removed the existing BaseCastConsumer listener com.joebutt.mouseworldradio.Live365Activity$5@43860568
09-02 09:11:06.805: D/ReceiverControlChannel(1109): [controller-0001] Received: {"requestId":0,"status":{"applications":[{"appId":"CC1AD845","displayName":"Default Media Receiver","namespaces":[{"name":"urn:x-cast:com.google.cast.player.message"},{"name":"urn:x-cast:com.google.cast.media"}],"sessionId":"AB8DF3E9-B0DE-C5AE-8935-337C4C1261CB","statusText":"Ready To Cast","transportId":"web-1"}],"isActiveInput":true,"isStandBy":false,"volume":{"level":1.0,"muted":false}},"type":"RECEIVER_STATUS"}
09-02 09:11:06.805: D/ReceiverControlChannel(1109): [controller-0001] requestId = 0, ignoreVolume = false
09-02 09:11:06.805: D/ReceiverControlChannel(1109): [controller-0001] onStatusReceived
09-02 09:11:06.805: D/CastDeviceController(1109): [controller-0001 MRP] processReceiverStatus: applicationInfo=bdv@42881ab0
09-02 09:11:06.805: D/CastRouteController(1109): [instance-1] onVolumeChanged to 1.000000, was 1.000000
09-02 09:11:06.815: D/ReceiverControlChannel(1109): [controller-0001] Received: {"requestId":0,"status":{"applications":[{"appId":"CC1AD845","displayName":"Default Media Receiver","namespaces":[{"name":"urn:x-cast:com.google.cast.player.message"},{"name":"urn:x-cast:com.google.cast.media"}],"sessionId":"AB8DF3E9-B0DE-C5AE-8935-337C4C1261CB","statusText":"Ready To Cast","transportId":"web-1"}],"isActiveInput":true,"isStandBy":false,"volume":{"level":1.0,"muted":false}},"type":"RECEIVER_STATUS"}
09-02 09:11:06.815: D/ReceiverControlChannel(1109): [controller-0001] requestId = 0, ignoreVolume = false
09-02 09:11:06.815: D/ReceiverControlChannel(1109): [controller-0001] onStatusReceived
09-02 09:11:06.815: D/CastDeviceController(1109): [controller-0001 MRP] processReceiverStatus: applicationInfo=bdv@428ae5e8
09-02 09:11:06.815: D/CastRouteController(1109): [instance-1] onVolumeChanged to 1.000000, was 1.000000
09-02 09:11:06.815: D/ReceiverControlChannel(1109): [controller-0001] Received: {"requestId":0,"status":{"applications":[{"appId":"CC1AD845","displayName":"Default Media Receiver","namespaces":[{"name":"urn:x-cast:com.google.cast.player.message"},{"name":"urn:x-cast:com.google.cast.media"}],"sessionId":"AB8DF3E9-B0DE-C5AE-8935-337C4C1261CB","statusText":"Ready To Cast","transportId":"web-1"}],"isActiveInput":true,"isStandBy":false,"volume":{"level":1.0,"muted":false}},"type":"RECEIVER_STATUS"}
09-02 09:11:06.815: D/ReceiverControlChannel(1109): [controller-0001] requestId = 0, ignoreVolume = false
09-02 09:11:06.815: D/ReceiverControlChannel(1109): [controller-0001] onStatusReceived
09-02 09:11:06.815: D/CastDeviceController(1109): [controller-0001 MRP] processReceiverStatus: applicationInfo=bdv@429df1d8
09-02 09:11:06.815: D/CastRouteController(1109): [instance-1] onVolumeChanged to 1.000000, was 1.000000
09-02 09:11:06.835: D/dalvikvm(1109): GC_CONCURRENT freed 981K, 9% free 19754K/21588K, paused 9ms+9ms, total 69ms
09-02 09:11:06.835: D/CastSocket(1109): [controller-0002] **** finished putting message onto circular buffer
09-02 09:11:06.835: D/CastSocketMultiplexer(1109): eventCount=0, mSockets.size=2, keys.size=0
09-02 09:11:06.835: D/CastSocket(1109): [controller-0001] updateSelectionKey when state=2
09-02 09:11:06.835: D/CastSocket(1109): [controller-0002] updateSelectionKey when state=2
09-02 09:11:06.835: D/CastSocketMultiplexer(1109): eventCount=1, mSockets.size=2, keys.size=1
09-02 09:11:06.835: D/CastSocket(1109): [controller-0002] onWritable when state is 2
09-02 09:11:06.845: D/CastSocket(1109): [controller-0001] updateSelectionKey when state=2
09-02 09:11:06.845: D/CastSocket(1109): [controller-0002] updateSelectionKey when state=2
09-02 09:11:06.845: D/ccl_VideoCastManager(25015): [v1.8] Updated context to: com.google.sample.castcompanionlibrary.cast.player.VideoCastControllerActivity@43b34918
09-02 09:11:06.845: D/ccl_VideoCastManager(25015): [v1.8] Updated context to: com.google.sample.castcompanionlibrary.cast.player.VideoCastControllerActivity@43b34918
09-02 09:11:06.845: D/ccl_VideoCastControlle(25015): [v1.8] setPlaybackStatus(): state = 4
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015): [v1.8] Failed to get playback and media information
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015): java.lang.NullPointerException
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at com.google.android.gms.cast.MediaMetadata.hashCode(Unknown Source)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at java.util.Arrays.hashCode(Arrays.java:1261)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at com.google.android.gms.internal.hk.hashCode(Unknown Source)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at com.google.android.gms.cast.MediaInfo.hashCode(Unknown Source)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at java.lang.Object.toString(Object.java:332)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at java.lang.StringBuilder.append(StringBuilder.java:202)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at com.google.sample.castcompanionlibrary.cast.VideoCastManager.loadMedia(VideoCastManager.java:1065)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at com.google.sample.castcompanionlibrary.cast.player.VideoCastControllerFragment.onReady(VideoCastControllerFragment.java:295)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at com.google.sample.castcompanionlibrary.cast.player.VideoCastControllerFragment.onCreate(VideoCastControllerFragment.java:140)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at android.support.v4.app.Fragment.performCreate(Fragment.java:1481)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:908)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1121)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1484)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:571)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1171)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at android.app.Activity.performStart(Activity.java:5241)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2157)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at android.app.ActivityThread.access$800(ActivityThread.java:135)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at android.os.Handler.dispatchMessage(Handler.java:102)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at android.os.Looper.loop(Looper.java:136)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at android.app.ActivityThread.main(ActivityThread.java:5001)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at java.lang.reflect.Method.invokeNative(Native Method)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at java.lang.reflect.Method.invoke(Method.java:515)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
09-02 09:11:06.855: E/ccl_VideoCastControlle(25015):    at dalvik.system.NativeStart.main(Native Method)
09-02 09:11:06.865: D/ccl_VideoCastControlle(25015): [v1.8] Stopped TrickPlay Timer
09-02 09:11:06.865: D/ccl_VideoCastControlle(25015): [v1.8] Restarted TrickPlay Timer
09-02 09:11:06.875: D/CastCompanionLibrary(25015): onResume() was called

0 个答案:

没有答案