适用于Xamarin的MediaManager插件 - 延迟播放流式广播

时间:2017-08-07 14:09:09

标签: xamarin xamarin.forms

当使用MediaManager Plugin for Xamarin时,使用以下代码行,如https://blog.xamarin.com/play-audio-and-video-with-the-mediamanager-plugin-for-xamarin/中给出的示例,声音将在大约1分钟后出现。

await Plugin.MediaManager.CrossMediaManager.Current.Play("http://abc.def.com/909fm");

有人可以帮忙解释为什么会如此以及如何纠正?

以下是日志:

08-07 21:47:53.978 D/Mono    ( 3790): Assembly Ref addref Plugin.MediaManager.Abstractions[0xb4928c40] -> System.Linq[0xb4ba9400]: 6
08-07 21:47:54.208 I/System.out( 3790): (HTTPLog)-Static: isSBSettingEnabled false
08-07 21:47:54.208 I/System.out( 3790): (HTTPLog)-Static: isShipBuild true
08-07 21:47:54.218 I/System.out( 3790): (HTTPLog)-Thread-3941-673792708: SmartBonding Enabling is false, SHIP_BUILD is true, log to file is false, DBG is false
08-07 21:47:54.218 I/System.out( 3790): (HTTPLog)-Thread-3941-673792708: SMARTBONDING_FEATURE_ENABLED is false
08-07 21:47:54.218 I/System.out( 3790): (HTTPLog)-Static: isSBSettingEnabled false
08-07 21:47:54.228 W/art     ( 3790): JNI RegisterNativeMethods: attempt to register 0 native methods for md5435d89a98283e2a2bf2d9830b2fb09a5.MediaServiceBinder
08-07 21:47:54.238 I/System.out( 3790): KnoxVpnUidStorageknoxVpnSupported API value returned is false
08-07 21:47:54.408 I/MediaPlayer( 3790): Need to enable context aware info
08-07 21:47:54.408 V/MediaPlayer-JNI( 3790): native_setup
08-07 21:47:54.408 V/MediaPlayer( 3790): constructor
08-07 21:47:54.418 V/MediaPlayer( 3790): setListener
08-07 21:47:54.418 E/MediaPlayer-JNI( 3790): QCMediaPlayer mediaplayer NOT present
08-07 21:47:54.418 V/MediaPlayer-JNI( 3790): setAudioStreamType: 3
08-07 21:47:54.418 V/MediaPlayer( 3790): MediaPlayer::setAudioStreamType
08-07 21:47:54.428 D/Mono    ( 3790): Assembly Ref addref Plugin.MediaManager[0xb4928d00] -> Xamarin.Android.Support.v7.AppCompat[0xb4ab2640]: 3
08-07 21:47:54.558 V/MediaPlayer-JNI( 3790): reset
08-07 21:47:54.558 V/MediaPlayer( 3790): reset
08-07 21:47:54.568 D/MediaPlayer( 3790): setDataSource IOException happend : 
08-07 21:47:54.568 D/MediaPlayer( 3790): java.io.FileNotFoundException: No content provider: http://abc.def.com/909fm
08-07 21:47:54.568 D/MediaPlayer( 3790):    at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1117)
08-07 21:47:54.568 D/MediaPlayer( 3790):    at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:970)
08-07 21:47:54.568 D/MediaPlayer( 3790):    at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:897)
08-07 21:47:54.568 D/MediaPlayer( 3790):    at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1112)
08-07 21:47:54.568 D/MediaPlayer( 3790): Couldn't open file on client side, trying server side
08-07 21:47:54.598 V/MediaPlayer( 3790): setVideoSurfaceTexture
08-07 21:47:54.598 V/MediaPlayer( 3790): prepareAsync
08-07 21:47:54.598 D/MediaHTTPConnection( 3790): setReadTimeOut =  30000ms
08-07 21:47:54.608 D/MediaHTTPConnection( 3790): setReadTimeout with 30000ms
08-07 21:47:54.608 I/System.out( 3790): (HTTPLog)-Static: isSBSettingEnabled false
08-07 21:47:54.608 I/System.out( 3790): KnoxVpnUidStorageknoxVpnSupported API value returned is false
08-07 21:47:54.798 V/MediaHTTPConnection( 3790): mTotalSize is -1
08-07 21:47:55.258 V/MediaHTTPConnection( 3790): mTotalSize is -1
08-07 21:47:59.778 D/Mono    ( 3790): [0x98953a00] worker finishing
Thread finished: <Thread Pool> #5
The thread 'Unknown' (0x5) has exited with code 0 (0x0).
Thread started: <Thread Pool> #8
08-07 21:48:22.358 D/Mono    ( 3790): [0x9824b380] worker starting
08-07 21:48:23.678 V/ActivityThread( 3790): updateVisibility : ActivityRecord{3fe24d46 token=android.os.BinderProxy@32c31335 {com.commute.android/md560486a52032bc8ca71ddb35fabfa6afb.MainActivity}} show : true
08-07 21:48:35.448 E/MediaMetadataRetrieverJNI( 3790): getEmbeddedPicture: Call to getEmbeddedPicture failed.
08-07 21:48:35.448 D/Mono    ( 3790): Assembly Ref addref Plugin.MediaManager[0xb4928d00] -> System[0xb4ba9dc0]: 14
08-07 21:48:35.488 D/Mono    ( 3790): Assembly Ref addref Plugin.MediaManager[0xb4928d00] -> Xamarin.Android.Support.Compat[0xb4ab2340]: 5
08-07 21:48:35.498 D/Mono    ( 3790): Assembly Ref addref Xamarin.Android.Support.v7.AppCompat[0xb4ab2640] -> Xamarin.Android.Support.Media.Compat[0xb4ab2520]: 3
08-07 21:48:35.528 D/Mono    ( 3790): DllImport searching in: '__Internal' ('(null)').
08-07 21:48:35.528 D/Mono    ( 3790): Searching for 'java_interop_jnienv_set_object_field'.
08-07 21:48:35.528 D/Mono    ( 3790): Probing 'java_interop_jnienv_set_object_field'.
08-07 21:48:35.528 D/Mono    ( 3790): Found as 'java_interop_jnienv_set_object_field'.
08-07 21:48:35.568 D/Mono    ( 3790): DllImport searching in: '__Internal' ('(null)').
08-07 21:48:35.568 D/Mono    ( 3790): Searching for 'java_interop_jnienv_get_object_field'.
08-07 21:48:35.568 D/Mono    ( 3790): Probing 'java_interop_jnienv_get_object_field'.
08-07 21:48:35.568 D/Mono    ( 3790): Found as 'java_interop_jnienv_get_object_field'.
Thread finished: <Thread Pool> #4
Thread started: <Thread Pool> #9
The thread 'Unknown' (0x4) has exited with code 0 (0x0).
08-07 21:49:01.378 D/Mono    ( 3790): [0xae973200] worker finishing
Thread finished: <Thread Pool> #7
The thread 'Unknown' (0x7) has exited with code 0 (0x0).
08-07 21:49:08.318 V/MediaPlayer( 3790): message received msg=200, ext1=973, ext2=0
08-07 21:49:08.328 W/MediaPlayer( 3790): info/warning (973, 0)
08-07 21:49:08.328 V/MediaPlayer( 3790): callback application
08-07 21:49:08.328 V/MediaPlayer( 3790): back from callback
08-07 21:49:08.448 V/MediaPlayer( 3790): message received msg=1, ext1=0, ext2=0
08-07 21:49:08.458 V/MediaPlayer( 3790): prepared
08-07 21:49:08.458 V/MediaPlayer( 3790): callback application
08-07 21:49:08.468 E/MediaPlayer( 3790): Should have subtitle controller already set
08-07 21:49:08.468 V/MediaPlayer( 3790): back from callback
08-07 21:49:08.498 V/MediaPlayer-JNI( 3790): start
08-07 21:49:08.498 V/MediaPlayer( 3790): start
08-07 21:49:08.608 D/Mono    ( 3790): DllImport searching in: '__Internal' ('(null)').
08-07 21:49:08.648 D/Mono    ( 3790): Searching for 'java_interop_jnienv_call_static_long_method_a'.
08-07 21:49:08.648 D/Mono    ( 3790): Probing 'java_interop_jnienv_call_static_long_method_a'.
08-07 21:49:08.648 D/Mono    ( 3790): Found as 'java_interop_jnienv_call_static_long_method_a'.
08-07 21:49:08.668 V/MediaPlayer( 3790): message received msg=6, ext1=0, ext2=0
08-07 21:49:08.668 V/MediaPlayer( 3790): Received MEDIA_STARTED
08-07 21:49:08.668 V/MediaPlayer( 3790): callback application
08-07 21:49:08.668 V/MediaPlayer( 3790): back from callback
08-07 21:49:08.668 V/MediaPlayer( 3790): message received msg=200, ext1=702, ext2=0
08-07 21:49:08.668 W/MediaPlayer( 3790): info/warning (702, 0)
08-07 21:49:08.668 V/MediaPlayer( 3790): callback application
08-07 21:49:08.668 V/MediaPlayer( 3790): back from callback
08-07 21:49:08.718 D/Mono    ( 3790): DllImport searching in: '__Internal' ('(null)').
08-07 21:49:08.718 D/Mono    ( 3790): Searching for 'java_interop_jnienv_call_boolean_method'.
08-07 21:49:08.718 D/Mono    ( 3790): Probing 'java_interop_jnienv_call_boolean_method'.
08-07 21:49:08.718 D/Mono    ( 3790): Found as 'java_interop_jnienv_call_boolean_method'.
Thread started:  #10
08-07 21:49:08.898 V/MediaPlayer-JNI( 3790): getCurrentPosition: 181 (msec)
08-07 21:49:08.908 V/MediaPlayer( 3790): getDuration_l
08-07 21:49:08.908 V/MediaPlayer-JNI( 3790): getDuration: 0 (msec)

0 个答案:

没有答案