Hi everyone,
I have a game that uses Cordova to work on Android devices and my problem is that video which is playable in the browser, is not playable in the WebView inside Cordova.
My code in Phaser:
let video = this.add
.video(config.width * 0.5, config.height * 0.5, "intro-video")
.setDisplaySize(config.width, config.height)
.on("complete", () => {
this.scene.start("WrakScene");
})
.setInteractive()
.on("pointerdown", () => {
this.scene.start("WrakScene");
});
video.video.setAttribute('webkit-playsinline', 'webkit-playsinline');
video.video.setAttribute('playsinline', 'playsinline');
video.play();
Logs from Android Studio:
W/AudioManager: Use of stream types is deprecated for operations other than volume control
W/AudioManager: See the documentation of requestAudioFocus() for what to use instead with android.media.AudioAttributes to qualify your playback use case
E/EGL_emulation: eglQueryContext 32c0 EGL_BAD_ATTRIBUTE
E/EGL_emulation: tid 6428: eglQueryContext(1903): error 0x3004 (EGL_BAD_ATTRIBUTE)
I/cr_MediaCodecBridge: create MediaCodec video decoder, mime video/avc
I/cr_MediaCodecBridge: create MediaCodec audio decoder, mime audio/mp4a-latm
I/OMXClient: IOmx service obtained
I/OMXClient: IOmx service obtained
I/MediaCodec: MediaCodec will operate in async mode
I/MediaCodec: MediaCodec will operate in async mode
D/SurfaceUtils: connecting to surface 0xbf649008, reason connectToSurface
I/MediaCodec: [OMX.android.goldfish.h264.decoder] setting surface generation to 6387715
D/SurfaceUtils: disconnecting from surface 0xbf649008, reason connectToSurface(reconnect)
D/SurfaceUtils: connecting to surface 0xbf649008, reason connectToSurface(reconnect)
E/ACodec: [OMX.android.goldfish.h264.decoder] setPortMode on output to DynamicANWBuffer failed w/ err -1010
D/SurfaceUtils: disconnecting from surface 0xbf649008, reason setNativeWindowSizeFormatAndUsage
D/SurfaceUtils: connecting to surface 0xbf649008, reason setNativeWindowSizeFormatAndUsage
D/SurfaceUtils: set up nativeWindow 0xbf649008 for 1280x720, color 0x13, rotation 0, usage 0x1002900
E/ACodec: [OMX.google.aac.decoder] ERROR(0x8000100b)
E/ACodec: signalError(omxError 0x8000100b, internalError -2147483648)
E/MediaCodec: Codec reported err 0x8000100b, actionCode 0, while in state 6
E/MediaCodec: getBufferAndFormat - not executing
E/cr_MediaCodecBridge: MediaCodec.onError: android.media.MediaCodec.error_neg_2147479541
E/cr_MediaCodecBridge: Failed to get input buffer
java.lang.IllegalStateException
at android.media.MediaCodec.getBuffer(Native Method)
at android.media.MediaCodec.getInputBuffer(MediaCodec.java:3212)
at org.chromium.media.MediaCodecBridge.getInputBuffer(PG:152)
E/chromium: [ERROR:media_codec_bridge_impl.cc(627)] GetInputBuffer failed
W/cr_MediaCodecBridge: Releasing: OMX.google.aac.decoder
W/cr_MediaCodecBridge: Codec released
W/cr_MediaCodecBridge: Releasing: OMX.android.goldfish.h264.decoder
D/SurfaceUtils: disconnecting from surface 0xbf649008, reason disconnectFromSurface
W/cr_MediaCodecBridge: Codec released
I/OpenGLRenderer: Davey! duration=1318ms; Flags=0, IntendedVsync=226251254408, Vsync=226251254408, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=226262690400, AnimationStart=226262749200, PerformTraversalsStart=226265842300, DrawStart=226265925700, SyncQueued=226266126800, SyncStart=226280223900, IssueDrawCommandsStart=226280302800, SwapBuffers=226303335100, FrameCompleted=227584120800, DequeueBufferDuration=0, QueueBufferDuration=0,
I/OpenGLRenderer: Davey! duration=1159ms; Flags=0, IntendedVsync=226267934234, Vsync=226267934234, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=226281412100, AnimationStart=226281457100, PerformTraversalsStart=226283101400, DrawStart=226283182700, SyncQueued=226283348200, SyncStart=227584120800, IssueDrawCommandsStart=227584120800, SwapBuffers=228638496440, FrameCompleted=228727861140, DequeueBufferDuration=1895000, QueueBufferDuration=28523000,
I/Choreographer: Skipped 68 frames! The application may be doing too much work on its main thread.
I/OpenGLRenderer: Davey! duration=1581ms; Flags=0, IntendedVsync=226284616796, Vsync=227567950078, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=227584120800, AnimationStart=227584120800, PerformTraversalsStart=227584120800, DrawStart=227584120800, SyncQueued=227584120800, SyncStart=228729495240, IssueDrawCommandsStart=228730536340, SwapBuffers=228894412940, FrameCompleted=229011377740, DequeueBufferDuration=915000, QueueBufferDuration=552000,
I/OpenGLRenderer: Davey! duration=1380ms; Flags=0, IntendedVsync=227584641299, Vsync=228717974587, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=228731532640, AnimationStart=228731577240, PerformTraversalsStart=228744650640, DrawStart=228744723340, SyncQueued=228744930040, SyncStart=229012727440, IssueDrawCommandsStart=229012844840, SwapBuffers=229087967540, FrameCompleted=229232666140, DequeueBufferDuration=476000, QueueBufferDuration=1260000,
I/OpenGLRenderer: Davey! duration=757ms; Flags=0, IntendedVsync=234817774326, Vsync=235101107648, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=235114446540, AnimationStart=235114487340, PerformTraversalsStart=235124397340, DrawStart=235124481240, SyncQueued=235124712540, SyncStart=235348859940, IssueDrawCommandsStart=235349024040, SwapBuffers=235783786540, FrameCompleted=235799756840, DequeueBufferDuration=637000, QueueBufferDuration=838000,
I/OpenGLRenderer: Davey! duration=1033ms; Flags=0, IntendedVsync=247317728684, Vsync=247467728678, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=247475967540, AnimationStart=247476037140, PerformTraversalsStart=247485454840, DrawStart=247488363040, SyncQueued=247488546840, SyncStart=247692247140, IssueDrawCommandsStart=247692402040, SwapBuffers=248509950340, FrameCompleted=248555278840, DequeueBufferDuration=849000, QueueBufferDuration=11580000,
I/Choreographer: Skipped 50 frames! The application may be doing too much work on its main thread.
Video just stops playing. Maybe it is a problem with video codec, because other video is working very well. How can I fix it?