I very want to play mp4 video in my android app. I even wrote a bit of code for it:
String sourceUrl = "http://tvstream.cn.ru/storage/1kanal/20120530/"
+ "1kanal-20120530-01-14-00-20120530-03-16-00.mp4";
final VideoView videoView = (VideoView) findViewById(R.id.videoView);
getWindow().setFormat(PixelFormat.TRANSLUCENT);
final MediaController mediaController = new MediaController(this);
mediaController.setMediaPlayer(videoView);
videoView.setMediaController(mediaController);
videoView.setVideoURI(Uri.parse(sourceUrl));
videoView.setOnPreparedListener(new OnPreparedListener() {
public void onPrepared(MediaPlayer mp) {
videoView.requestFocus();
videoView.start();
mediaController.show();
}
});
But nothing works :( When I launch my app in emulator (Android 2.3.3) I've got weird stacktrace with some common error codes:
After few hours off googling and experiments I decided to try to launch my app on real device and watch logcat:
D/test.tv.activity.PlayerActivity( 3428): Player source: http://tvstream.cn.ru/storage/1kanal/20120530/1kanal-20120530-01-14-00-20120530-03-16-00.mp4
D/VideoView( 3428): onMeasure()
I/VideoView( 3428): Setting size: 320x430
I/Launcher( 260): onWindowFocusChanged(false)
D/Launcher( 260): setWallpaperDimension() called
D/Launcher( 260): USE_NON_SCROLLABLE_IMAGE_WALLPAPER is true
I/ActivityManager( 163): Start proc org.reactivephone for broadcast org.reactivephone/ru.yandex.common.clid.ClidBroadcastReceiver: pid=3448 uid=10073 gids={1015, 3003}
I/ActivityManager( 163): No longer want com.sec.android.provider.badge (pid 2310): hidden #16
I/MediaPlayer( 3428): uri is:http://tvstream.cn.ru/storage/1kanal/20120530/1kanal-20120530-01-14-00-20120530-03-16-00.mp4
I/MediaPlayer( 3428): path is null
D/MediaPlayer( 3428): Couldn't open file on client side, trying server side
D/Launcher( 260): It's image wallpaper. suggestDesiredDimensions(-1,-1)
I/ActivityManager( 163): Displayed test.tv/.activity.PlayerActivity: +943ms
D/VideoView( 3428): onMeasure()
I/VideoView( 3428): Setting size: 320x430
W/dalvikvm( 3406): threadid=5: spin on suspend #1 threadid=22 (pcf=0)
W/dalvikvm( 3406): threadid=5: spin on suspend resolved in 1154 msec
W/SearchableInfo( 163): Invalid searchable metadata for org.reactivephone/.ui.RegionForm: Search label must be a resource reference.
I/ActivityManager( 163): Start proc com.google.android.googlequicksearchbox for broadcast com.google.android.googlequicksearchbox/.SourceUpdateReceiver: pid=3457 uid=10027 gids={3003}
I/WindowOrientationListener( 163): orientation 295.6932 gives new rotation = 2
I/OrientationDebug( 163): [pwm] in MyOrientationListener.onOrientationChanged() rotation=3 mFancyRotationAnimation=0 now call mWindowManager.setRotation()
I/OrientationDebug( 163): [wms] in setRotation() rotation=3 alwaysSendConfiguration=false animFlags=0
I/OrientationDebug( 163): [wms] in setRotation() now call setRotationUnchecked()
I/WindowManager( 163): Setting rotation to 3, animFlags=0
I/ActivityManager( 163): Config changed: { scale=1.0 imsi=250/1 loc=ru_RU touch=3 keys=1/1/2 nav=1/1 orien=2 layout=18 uiMode=17 seq=7}
D/PhoneApp( 241): updateProximitySensorMode: lock already released.
I/ActivityThread( 3457): Pub com.google.android.googlequicksearchbox.shortcuts: com.google.android.googlequicksearchbox.WebHistoryProvider
I/ActivityThread( 3457): Pub com.google.android.googlequicksearchbox.google: com.google.android.googlequicksearchbox.google.GoogleSuggestionProvider
I/ActivityManager( 163): No longer want com.sec.android.widgetapp.clockweather.clockwidget (pid 1214): hidden #16
D/Finsky ( 3406): [1] 2.run: Loaded library for account: [Y091GklnFtI4Ab1gmLOw-nJkJXQ]
D/Finsky ( 3406): [1] 2.run: Finished loading 1 libraries.
W/dalvikvm( 3406): VFY: unable to resolve instance field 78
D/DfeApi ( 3406): [1] DfeApiContext.getSmallestScreenWidthDp: smallestScreenWidthDp does not exist, using pre-ics hack.
E/QCvdec ( 95): Setparameter: unknown param 2130706451
W/TimedEventQueue( 95): Event 3 was not found in the queue, already cancelled?
E/QCvdec ( 95): Omx Flush issued when vdec is not initialized yet.
W/QCvdec ( 95): ======================================================================
W/QCvdec ( 95): Open Max Statistics
W/QCvdec ( 95): ======================================================================
W/QCvdec ( 95): empty this buffer rate = NaN
W/QCvdec ( 95): empty this buffer total time = 0
W/QCvdec ( 95): empty this buffer count = 0
W/QCvdec ( 95): ======================================================================
D/test.tv.activity.PlayerActivity( 3428): Player source: http://tvstream.cn.ru/storage/1kanal/20120530/1kanal-20120530-01-14-00-20120530-03-16-00.mp4
D/VideoView( 3428): onMeasure()
I/VideoView( 3428): Setting size: 480x270
I/MediaPlayer( 3428): uri is:http://tvstream.cn.ru/storage/1kanal/20120530/1kanal-20120530-01-14-00-20120530-03-16-00.mp4
I/MediaPlayer( 3428): path is null
D/MediaPlayer( 3428): Couldn't open file on client side, trying server side
D/VideoView( 3428): onMeasure()
I/VideoView( 3428): Setting size: 480x270
D/WifiService( 163): [mPersistState] : On
D/BatteryService( 163): update start
D/BatteryService( 163): update start
D/BatteryService( 163): update start
E/QCvdec ( 95): Setparameter: unknown param 2130706451
I/VideoView( 3428): start()
D/WifiService( 163): [mPersistState] : On
D/WifiService( 163): [mPersistState] : On
D/WifiWatchdogService( 163): (android.server.ServerThread) wntk (1c:af:f7:2e:7f:c8) does not require the watchdog
E/QCvdec ( 95): Unsupported profile, level, or widht, height
E/QCvdec ( 95): Unsupported clip
E/QCvdec ( 95): Unsupported profile, level, or widht, height
E/QCvdec ( 95): Unsupported clip
E/QCvdec ( 95): Omx Flush issued when vdec is not initialized yet.
E/QCvdec ( 95): Omx Flush issued when vdec is not initialized yet.
E/QCvdec ( 95): Empty this buffer in Invalid State
E/OMXCodec( 95): [OMX.qcom.video.decoder.avc] ERROR(0x8000100a, 0)
E/OMXCodec( 95): [OMX.qcom.video.decoder.avc] ERROR(0x8000100a, 0)
E/OMXCodec( 95): read : mState[9] is wrong...
E/MediaPlayer( 3428): error (1, -2147483648)
E/OMXCodec( 95): [OMX.qcom.video.decoder.avc] ERROR(0x8000100a, 0)
E/QCvdec ( 95): Omx Flush issued when vdec is not initialized yet.
D/VideoView( 3428): onMeasure()
I/VideoView( 3428): Setting size: 335x270
I/VideoView( 3428): start()
E/MediaPlayer( 3428): start called in state 0
E/MediaPlayer( 3428): error (-38, 0)
E/MediaPlayer( 3428): Error (1,-2147483648)
D/VideoView( 3428): Error: 1,-2147483648
E/MediaPlayer( 3428): Error (-38,0)
D/VideoView( 3428): Error: -38,0
D/PowerManagerService( 163): reactivateScreenLocksLocked mProxIgnoredBecauseScreenTurnedOff=false
I/PowerManagerService( 163): Ulight 1->3|0
W/InputManagerService( 163): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#40873ab8
I/PowerManagerService( 163): Light Animator Finished curIntValue=141
D/Finsky ( 3406): [1] 5.onFinished: Installation state replication succeeded.
D/BatteryService( 163): update start
D/BatteryService( 163): update start
D/BatteryService( 163): update start
I try to find something about "OMX.qcom.video.decoder.avc] ERROR(0x8000100a, 0)", but didn't find nothing interesting. About "Couldn't open file on client side, trying server side" problem stackoverflow has many answers, but no one helped.
When I launch this app on ICS (in emulator) I've got similar errors:
06-01 10:22:14.674: I/NuCachedSource2(37): ERROR_END_OF_STREAM
06-01 10:22:15.375: I/OMXCodec(37): [OMX.google.h264.decoder] AVC profile = 100 (High), level = 30
06-01 10:22:15.384: I/OMXCodec(37): [OMX.google.h264.decoder] video dimensions are 320 x 240
06-01 10:22:15.384: I/OMXCodec(37): [OMX.google.h264.decoder] Crop rect is 320 x 240 # (0, 0)
06-01 10:22:16.253: W/NetworkManagementSocketTagger(89): setKernelCountSet(10013, 0) failed with errno -2
06-01 10:22:16.374: I/Launcher(553): setLoadOnResume
06-01 10:22:16.584: D/MediaPlayer(602): getMetadata
06-01 10:22:16.614: I/NuCachedSource2(37): new range: offset= 0
06-01 10:22:16.694: I/ChromiumHTTPDataSource(37): connect to http://tvstream.cn.ru/storage/1kanal/20120530/1kanal-20120530-01-14-00-20120530-03-16-00.mp4 #0
06-01 10:22:16.834: E/SoftAVC(37): Decoder failed: -2
06-01 10:22:16.844: E/OMXCodec(37): [OMX.google.h264.decoder] ERROR(0x80001001, -1007)
06-01 10:22:16.884: D/AudioSink(37): bufferCount (4) is too small and increased to 12
As I know, Android supports playback of video decoded with h264 (http://developer.android.com/guide/appendix/media-formats.html). So, can anyone tell me what I do wrong.
Probably your file is using an unsupported profile, notice that official media formats page only lists Baseline Profile as supported for H.264 AVC.
Try transcoding the video specifying Baseline Profile as suggested in this stackoverflow question, i.e. if your container is MP4 run:
ffmpeg -i yourfile.mp4 -c:v libx264 -profile:v baseline -level 1 yourfile_BaselineProfile.mp4
If this works it's not a issue in your code, you just have to use supported formats.
Try this
File clip=new File(Environment.getExternalStorageDirectory(),
"test.mp4");
if (clip.exists()) {
video=(VideoView)findViewById(R.id.video);
video.setVideoPath(clip.getAbsolutePath());
ctlr=new MediaController(this);
ctlr.setMediaPlayer(video);
video.setMediaController(ctlr);
video.requestFocus();
video.start();
VideoView classes does not allow playing MP4 file format videos. Please go through this link for Android Media Formats. Try checking your video with Daroon Player
Related
The videos are mp4. All other videos work fine, but weirdly, only certain videos come out this way.
I/ACodec (27533): codec does not support config priority (err -2147483648)
I was offered to change the audio codec while searching.
I tried encoding it with AAC, AC3, and MPEG but couldn't solve it. (I tried with each file)
It's really weird. The audio is a bit stuttering. It doesn't sound very annoying, but it certainly seems to be a bit cut off.
Does anyone know how to do this? Any advice would be appreciated. thank you.
I/ExoPlayerImpl( 8291): Init 6c53ea1 [ExoPlayerLib/2.12.1] [generic_x86_64, Android SDK built for x86_64, unknown, 24]
D/MetadataUtil( 8291): Skipped unknown metadata entry: ������
I/art ( 8291): Do partial code cache collection, code=25KB, data=24KB
I/art ( 8291): After code cache collection, code=23KB, data=23KB
I/art ( 8291): Increasing code cache capacity to 128KB
I/VideoCapabilities( 8291): Unsupported profile 4 for video/mp4v-es
I/OMXClient( 8291): MuxOMX ctor
I/MediaCodec( 8291): [OMX.google.h264.decoder] setting surface generation to 8489985
E/ACodec ( 8291): [OMX.google.h264.decoder] storeMetaDataInBuffers failed w/ err -1010
I/ACodec ( 8291): codec does not support config priority (err -2147483648)
I/ACodec ( 8291): codec does not support config operating rate (err -2147483648)
I/OMXClient( 8291): MuxOMX ctor
I/ACodec ( 8291): codec does not support config priority (err -2147483648)
D/AudioTrack( 8291): Client defaulted notificationFrames to 3675 for frameCount 11025
D/MediaCodec( 8291): [OMX.google.h264.decoder] setting dataspace on output surface to #104
D/ ( 8291): HostConnection::get() New Host Connection established 0x77a6caeb31c0, tid 8420
D/SoftwareRenderer( 8291): setting dataspace on output surface to #104
I/art ( 8291): Do partial code cache collection, code=61KB, data=59KB
I/art ( 8291): After code cache collection, code=58KB, data=57KB
I/art ( 8291): Increasing code cache capacity to 256KB
I am trying to develop a surveillance application in OMAP 4460(Blaze Tablet-in ICS) acting as client device rendering the surveillance feed from a remote source. To begin with, surveillance feed is streamed remotely from the camera and port forwarded as RTP packets which are received and rendered in OMAP 4460 through a customized RTP stack. While rendering, I am getting the following error from the decoder, saying that "Surface Texture has been abandoned and native_window _set_buffers_geometry failed", more frequently.
Following is the log captured:
E/AwesomePlayer( 131): AwesomePlayer::onPrepareAsyncEvent-------- err = 0
E/AwesomePlayer( 131): AwesomePlayer::onPrepareAsyncEvent-------- OK = -430191887
I/OMXCodec( 131): [OMX.TI.DUCATI1.VIDEO.DECODER] AVC profile = 66 (Baseline), level = 31
E/OMXCodec( 131): set buffer size variable to : 307200
I/OMXCodec( 131): [OMX.TI.DUCATI1.VIDEO.DECODER] video dimensions are 640 x 480
I/OMXCodec( 131): [OMX.TI.DUCATI1.VIDEO.DECODER] Crop rect is 640 x 480 # (0, 0)
E/SurfaceTexture( 128): [SurfaceView] setCrop: SurfaceTexture has been abandoned!
E/SurfaceTextureClient( 131): ISurfaceTexture::setCrop(...) returned No such device
E/SurfaceTexture( 128): [SurfaceView] setLayout: SurfaceTexture has been abandoned!
E/SurfaceTexture( 128): [SurfaceView] setCrop: SurfaceTexture has been abandoned!
E/SurfaceTextureClient( 131): ISurfaceTexture::setCrop(...) returned No such device
E/OMXCodec( 131): native_window_set_buffers_geometry failed: No such device (19)
E/ion ( 131): ioctl -1073460991 failed with code -1: Bad file number
E/ion ( 131): ioctl -1073460991 failed with code -1: Bad file number
D/DOMX ( 131): hardware/ti/domx/domx/omx_proxy_common/src/omx_proxy_common.c:2208 PROXY_ComponentDeInit()
D/DOMX ( 131): ERROR: failed check:(eError == OMX_ErrorNone) || (eError == OMX_ErrorNoMore) - returning error: 0x80001011 - Error returned from OMX API in ducati
D/DOMX ( 131): hardware/ti/domx/omx_core/src/OMX_Core.c:396 OMX_FreeHandle()
D/DOMX ( 131): ERROR: Error From ComponentDeInit..
D/StackInterface( 131): AwesomePlayer::reset_l called ++
SDP of the camera:
v=0
o=StreamingServer 3331435948 1116907222000 IN IP4 192.168.1.102
s=h264.mp4
c=IN IP4 239.0.0.00;/1
t=0 0
a=control:*
m=video 0 RTP/AVP 96
a=control:trackID=0
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1; sprop-parameter-sets=Z0KAH9oCgPSbgIEAmBAAfQAAEZQve+Eg,aM48gA==
m=application 0 RTP/AVP 107
a=control:trackID=2
a=rtpmap:107 vnd.onvif.metadata/90000
I have been trying to fix this issue for sometime now, and could not able to find out the problem yet.
Kindly, reveal how to proceed further on the issue.
Regards,
Manoj
My English is not good.
Check SurfaceTexture pointer.
If you define sp<.....> in function, sp<.....> is abandoned with end of function.
I am trying to play a file i have recorded. The file plays well in vlc(linux pc) and in Moboplayer(android tablet). While using the default player in the android tablet it shows this in logcat.
I/ActivityManager( 201): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.example.mymediaplayer/.MyVideoView bnds=[656,246][752,342]} from pid 417
I/System.out(20286): MyVideoView.onCreate()
I/System.out(20286): MyVideoView.onResume()
V/TabletStatusBar( 281): setLightsOn(true)
I/AwesomePlayer( 141): setDataSource_l('/sdcard/video/TunerOut.ts')
I/avc_utils( 141): found AVC codec config (720 x 480, Baseline-profile level 3.1)
I/MPEG2TSExtractor( 141): haveAudio=1, haveVideo=1
E/OMXCodec( 141): Attempting to allocate OMX node 'OMX.TI.DUCATI1.VIDEO.DECODER'
E/OMXCodec( 141): Attempting to allocate OMX node 'OMX.Nvidia.h264.decode'
E/OMXCodec( 141): Attempting to allocate OMX node 'OMX.qcom.7x30.video.decoder.avc'
E/OMXCodec( 141): Attempting to allocate OMX node 'OMX.qcom.video.decoder.avc'
E/OMXCodec( 141): Attempting to allocate OMX node 'OMX.TI.Video.Decoder'
E/OMXCodec( 141): Attempting to allocate OMX node 'OMX.SEC.AVC.Decoder'
E/OMXCodec( 141): Successfully allocated OMX node 'OMX.SEC.AVC.Decoder'
I/OMXCodec( 141): [OMX.SEC.AVC.Decoder] AVC profile = 66 (Baseline), level = 31
E/OMXCodec( 141): [OMX.SEC.AVC.Decoder] Video O/P format.eColorFormat 0x40b452b1
I/OMXCodec( 141): [OMX.SEC.AVC.Decoder] video dimensions are 720 x 480
D/OpenGLRenderer( 417): Flushing caches (mode 1)
I/ActivityManager( 201): Displayed com.example.mymediaplayer/.MyVideoView: +323ms
W/InputManagerService( 201): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy#4106dc38 (uid=10036 pid=20503)
W/IInputConnectionWrapper(20503): showStatusIcon on inactive InputConnection
E/OMXCodec( 141): Attempting to allocate OMX node 'OMX.Nvidia.mp2.decoder'
**E/MediaPlayer(20286): error (1, -2147483648)
E/MediaPlayer(20286): Error (1,-2147483648)
D/VideoView(20286): Error: 1,-2147483648**
D/OpenGLRenderer( 417): Flushing caches (mode 0)
W/InputManagerService( 201): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#41033300
D/AudioHardware( 141): AudioHardware pcm playback is going to standby.
what is error 1,-2147483648
I just had that error too. The reason (in my case) was that the mp3 has the wrong format, i.e.
MPEG ADTS, layer II, v1, 192 kbps, 44.1 kHz, Stereo
while a "good" mp3 has this format:
MPEG ADTS, layer III, v1, 128 kbps, 44.1 kHz, JntStereo
I'm using the Facebook SDK on Android to post an update to the user's feed. I was able to get it to work when I did not have the Facebook client installed. Now, even after removing the Facebook app, when I try to authorize or open the feed dialog the activity is abrupty killed.
I don't get any message telling me that the app has crashed or anything. It's just destroyed. The only message is Mono telling me that the thread 0x0 has been prematurely finalized, which is odd. Also, there's this odd "Not supported in this case." message from webcore.
I'm using the NativeActivity class. I don't use it directly but I extend it in my activity. Here's the logcat from around where things go wrong:
I/PixelWorldEngine( 6796): Authorizing for Facebook...
D/Database( 6796): dbopen(): path = /data/data/com.ri.BubblingUpLite/databases/webview.db, flag = 6, cannot stat file, error message: No such file or directory
D/Database( 6796): dbopen(): path = /data/data/com.ri.BubblingUpLite/databases/webview.db, mode: delete, disk free size: 35 M, handle: 0x801450
D/Database( 6796): dbopen(): path = /data/data/com.ri.BubblingUpLite/databases/webviewCache.db, flag = 6, cannot stat file, error message: No such file or directory
D/Database( 6796): dbopen(): path = /data/data/com.ri.BubblingUpLite/databases/webviewCache.db, mode: delete, disk free size: 35 M, handle: 0x7ff128
D/skia ( 6796): htcFlashPlugin::htcFlashPlugin
W/webcore ( 6796): Not supported in this case.
I/PixelWorld-glue( 6796): WindowFocusChanged: 0x333288 -- 0
D/SensorService( 120): disable: connection.get() = 0x9f5c20
D/SensorService( 120): disable: get sensor name = BMA150 3-axis Accelerometer
D/SensorService( 120): SensorDevice::activate: handle = 0x0, enabled = 0x0
D/Sensors ( 120): Enable akm: en = 0
D/SensorService( 120): noteStopSensor: uid = 0x274d, handle = 0x0
D/SensorService( 120): pid=6796, uid=10061
D/SensorService( 120): Active sensors:
D/SensorService( 120): CM3602 Light sensor (handle=0x00000004, connections=1)
W/webcore ( 6796): Not supported in this case.
W/mono ( 6796): Thread 0x0 may have been prematurely finalized
D/SensorGUI( 120): ~SensorChannel: mSendFd = 255, mReceiveFd = -1
D/AudioPolicyService( 72): stopOutput() tid 2223
D/AudioPolicyService( 72): releaseOutput() tid 2223
D/AudioPolicyService( 72): releaseOutput() tid 2223
I/ActivityManager( 120): Process com.ri.BubblingUpLite (pid 6796) has died.
I/WindowManager( 120): WIN DEATH: Window{407e9548 com.ri.BubblingUpLite/com.ri.PixelWorldEngine.GameActivity paused=false}
I think it's an Android bug which seems to manifest on HTC devices.
See http://code.google.com/p/android/issues/detail?id=33612
I have an app that I'm writing for both iOS and Android. I have a content page with which I need to link to/play a .mp4 video in a UIWebView/WebView. The video is going to be included in the app so that it can work offline.
With iOS I just used a video tag (with source to a project file) and then used NSNotifications to fullscreen and landscape the video (app normally runs in portrait mode). Job done.
On Android I'm having some issues.
Firstly, when you use a local image as the video poster it crashed the app (apparently a known bug - using a remote image solves the problem - although not much help for an offline mode).
Secondly it doesn't play. I've tried both a remote and local file (referenced as file:///android_asset/html/video.mp4).
I've tested the .mp4 from the android browser and it plays okay so I know that the video is fine.
I've tried a different tack using a link to a video instead. I found an example at the following link (have to use google cache to view): http://webcache.googleusercontent.com/search?q=cache:EVz7nwc8718J:www.codelark.com/2010/05/12/android-viewing-video-from-embedded-webview/+http://www.codelark.com/2010/05/12/android-viewing-video-from-embedded-webview/&cd=1&hl=en&ct=clnk&gl=uk
My code is as follows:
webengine = (WebView) findViewById(R.id.webview);
webengine.getSettings().setJavaScriptEnabled(true);
webengine.getSettings().setPluginsEnabled(true);
webengine.getSettings().setAllowFileAccess(true);
webengine.setDownloadListener(new DownloadListener()
{
public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimeType, long size)
{
Intent viewIntent = new Intent(Intent.ACTION_VIEW);
viewIntent.setDataAndType(Uri.parse(url), mimeType);
try
{
startActivity(viewIntent);
}
catch (ActivityNotFoundException ex)
{
Log.w("sta", "Couldn't find activity to view mimetype: " + mimeType);
}
}
});
webengine.loadUrl("file:///android_asset/html/index.html");
With a remote video link it tries to open the android browser and then bails back to the app. With a local video link it appears to load the player but I get "Cannot play video - Sorry, this video cannot be played"
This is my logcat log:
I/ActivityManager( 168): Starting: Intent { act=android.intent.action.VIEW dat=file:///android_asset/html/standrewsanimation.mp4 typ=video/mp4 cmp=com.cooliris.media/.MovieView } from pid 4299
W/ActivityManager( 168): Trying to launch com.cooliris.media/.MovieView
I/WindowManager( 168): Setting rotation to 1, animFlags=1
I/ActivityManager( 168): Config changed: { scale=1.0 imsi=234/20 loc=en_GB touch=3 keys=1/1/2 nav=1/1 orien=2 layout=18 uiMode=17 seq=40}
D/PhoneApp( 301): updateProximitySensorMode: lock already released.
I/ApplicationPackageManager( 3982): cscCountry is not German : H3G
D/MovieView( 3982): onCreate
I/MovieView( 3982): registerBroadcastRecievers
D/MovieViewControl( 3982): getFilePathByUri URI : file:///android_asset/html/standrewsanimation.mp4
D/MovieViewControl( 3982): getFilePathByUri path from DB - Path : null
D/MovieViewControl( 3982): getFilePathByUri path from uri - Path : /android_asset/html/standrewsanimation.mp4
D/MovieViewControl( 3982): checkDRMContent() path : /android_asset/html/standrewsanimation.mp4 URI : file:///android_asset/html/standrewsanimation.mp4
W/System.err( 3982): java.io.FileNotFoundException: File is not present
W/System.err( 3982): at android.drm.mobile2.OMADRMManager.IsDrmFileByExt(OMADRMManager.java:1032)
W/System.err( 3982): at com.cooliris.media.VideoDRMUtil.checkIsOMADrm(VideoDRMUtil.java:169)
W/System.err( 3982): at com.cooliris.media.MovieViewControl.checkDRMContent(MovieViewControl.java:236)
W/System.err( 3982): at com.cooliris.media.MovieViewControl.<init>(MovieViewControl.java:168)
W/System.err( 3982): at com.cooliris.media.MovieView$1.<init>(MovieView.java:68)
W/System.err( 3982): at com.cooliris.media.MovieView.onCreate(MovieView.java:68)
W/System.err( 3982): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
W/System.err( 3982): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
W/System.err( 3982): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
W/System.err( 3982): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
W/System.err( 3982): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
W/System.err( 3982): at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err( 3982): at android.os.Looper.loop(Looper.java:123)
W/System.err( 3982): at android.app.ActivityThread.main(ActivityThread.java:3687)
W/System.err( 3982): at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err( 3982): at java.lang.reflect.Method.invoke(Method.java:507)
W/System.err( 3982): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
W/System.err( 3982): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
W/System.err( 3982): at dalvik.system.NativeStart.main(Native Method)
I/VideoView( 3982): start()
D/MovieView( 3982): onStart
D/MovieView( 3982): onResume
D/MovieViewControl( 3982): onResume()
D/VideoView( 3982): onMeasure()
I/VideoView( 3982): Setting size: 480x320
D/VideoView( 3982): onMeasure()
I/VideoView( 3982): Setting size: 480x320
V/AudioPolicyManager( 95): stopOutput() output 1, stream 1, session 301
V/AudioPolicyManager( 95): getNewDevice() selected device 0
V/AudioPolicyManager( 95): getNewDevice() selected device 0
V/AudioPolicyManager( 95): setOutputDevice() output 1 device 0 delayMs 150
V/AudioPolicyManager( 95): setOutputDevice() setting same device 0 or null device for output 1
I/ActivityManager( 168): Displayed com.cooliris.media/.MovieView: +287ms
V/PVPlayer( 95): PVPlayer constructor
V/PVPlayer( 95): construct PlayerDriver
V/PlayerDriver( 95): constructor
V/PlayerDriver( 95): OpenCore hardware module loaded
V/PlayerDriver( 95): start player thread
V/PlayerDriver( 95): startPlayerThread
V/PlayerDriver( 95): InitializeForThread
V/PlayerDriver( 95): OMX_MasterInit
V/PlayerDriver( 95): OsclScheduler::Init
V/PlayerDriver( 95): CreatePlayer
V/PlayerDriver( 95): AddToScheduler
V/PlayerDriver( 95): PendForExec
V/PlayerDriver( 95): OsclActiveScheduler::Current
V/PlayerDriver( 95): StartScheduler
V/PVPlayer( 95): send PLAYER_SETUP
V/PlayerDriver( 95): Send player code: 2
V/PlayerDriver( 95): CommandCompleted
V/PlayerDriver( 95): Completed command PLAYER_SETUP status=PVMFSuccess
V/PVPlayer( 95): setDataSource(/android_asset/html/standrewsanimation.mp4)
V/PVPlayer( 95): setVideoSurface(0x5dbb8)
V/PVPlayer( 95): setVideoSurface(0x5f1d0)
V/PVPlayer( 95): prepareAsync
V/PVPlayer( 95): data source = /android_asset/html/standrewsanimation.mp4
V/PlayerDriver( 95): Send player code: 3
V/PlayerDriver( 95): handleSetDataSource
V/PlayerDriver( 95): handleSetDataSource- scanning for extension
V/PlayerDriver( 95): HandleInformationalEvent: PVMFInfoErrorHandlingStart
V/PlayerDriver( 95): HandleInformationalEvent: type=26 UNHANDLED
W/MediaPlayer( 3982): info/warning (1, 26)
V/PlayerDriver( 95): CommandCompleted
V/PlayerDriver( 95): Completed command PLAYER_SET_DATA_SOURCE status=PVMFErrNotSupported
E/PlayerDriver( 95): Command PLAYER_SET_DATA_SOURCE completed with an error or info PVMFErrNotSupported
E/MediaPlayer( 3982): error (1, -4)
V/PVPlayer( 95): run_init s=-2147483648, cancelled=0
V/PlayerDriver( 95): HandleInformationalEvent: PVMFInfoErrorHandlingComplete
W/PlayerDriver( 95): PVMFInfoErrorHandlingComplete
I/PowerManagerService( 168): Ulight 3->3|12
I/MediaPlayer( 3982): Info (1,26)
E/MediaPlayer( 3982): Error (1,-4)
D/VideoView( 3982): Error: 1,-4
D/VideoView( 3982): onMeasure()
I/VideoView( 3982): Setting size: 480x320
D/VideoView( 3982): onMeasure()
I/VideoView( 3982): Setting size: 480x320
I've also tried the above approach in shouldOverrideUrlLoading which has the same result.
Thanks
I was stuck in a similar problem. Finalyl I got the thing working by using "video" HTML5 tag
There is something in android OS that prevent opening the video from
assets. I had to copy the html and video to SDCard. You can then use the sdcard path instead of assets path.
Dont forget to use android:hardwareAcceletrated = "true" for your webview activity