videoview

Android VideoView Error 1,0

匿名 (未验证) 提交于 2019-12-03 08:28:06
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have an application thats main goal is to play a specific video file. it plays the video correctly sometimes. But other times it gives me this error: 03-21 14:52:36.181: I/AwesomePlayer(119): setDataSource_l('/data/data/my.package.name/files/MyMovie.mp4') 03-21 14:52:36.196: W/VideoView(26612): Unable to open content: /data/data/my.package.name/files/MyMovie.mp4 03-21 14:52:36.196: W/VideoView(26612): java.lang.IllegalArgumentException: The surface has been released 03-21 14:52:36.196: W/VideoView(26612): at android.media.MediaPlayer.

VideoView triggers OnPreparedListener too early for HLS

匿名 (未验证) 提交于 2019-12-03 03:05:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to show user some ProgressDialog while he waits for VideoView to start play HLS. I try to use OnPreparedListener for this, but he triggers to early (after player downloaded m3u8 file, not when video started). VideoView player = (VideoView) findViewById(R.id.player); String httpLiveUrl = "http://example.com/playlist.m3u8"; player.setVideoURI(Uri.parse(httpLiveUrl)); player.setMediaController(new MediaController(this)); player.requestFocus(); player.setOnPreparedListener(new OnPreparedListener() { public void onPrepared(MediaPlayer mp)

android videoview error 1, -2147483648

匿名 (未验证) 提交于 2019-12-03 03:03:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am getting error while playing video from asset folder and raw folder. MediaPlayer error (1, -2147483648) VideoView error 1, -2147483648. I tried from asset folder as. private String SrcPath = "file:///android_asset/aaa.mp4"; //also tried aaaa.mp3 VideoView vv = (VideoView)findViewById(R.id.videoView1); vv.setVideoPath(SrcPath); MediaController controller = new MediaController(this); controller.setAnchorView(vv); vv.setMediaController(controller); vv.requestFocus(); vv.start(); and for raw folder i used URI as : Uri video = Uri.parse(

Android VideoView not playing sequential videos

匿名 (未验证) 提交于 2019-12-03 03:02:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to play 2 videos in a row. The first video always plays just fine. After it finishes, you can see in the log that it sets the new video URL, but then SurfaceView throws an error and the VideoView just freezes with the last frame of the first video. Nothing else happens. Any thoughts ? Thanks ! LE: Surprisingly, the OnPreparedListener gets called for the second video. LE2: Sometimes the second video plays just fine, sometimes it doesn't... and I haven't changed a line of code between when it worked and when not. It's purely random...

Android TextureView vs VideoView Performance

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need to be able to rotate a video on screen, so I created a custom TextureView which provides a convenience layer over a MediaPlayer similar to how the current implementation of VideoView does. This Android blog post says the following about TextureView: Because a SurfaceView’s content does not live in the application’s window, it cannot be transformed (moved, scaled, rotated) efficiently. This makes it difficult to use a SurfaceView inside a ListView or a ScrollView. SurfaceView also cannot interact properly with some features of the UI

Android MediaPlayer/VideoView error (1, -2147483648)

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've been having an inconsistent experience with setting a VideoView's video from a file path. VideoView myVideoView = findViewById(R.id.videoView); ... myVideoView.setVideoPath(videoFilename); ... myVideoView.start(); videoFilename is the absolute path of a video in my cache directory: String videoFilename = new File(context.getCacheDir(), "myawesomevideo.mp4").getAbsolutePath(); In Android SDK >= 16 (Jelly Bean), this works just fine and my awesome video plays. In Android 4.0.4 (SDK = 15), the MediaPlayer breaks when myVideoView.start() is

android videoview scalemode

匿名 (未验证) 提交于 2019-12-03 01:41:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: i set my videoView width & height : "fill_parent" but i want it to fit screen(full screen , don't keep it original ratio) how can i scale it? 回答1: if you add: android:layout_alignParentRight="true" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_alignParentBottom="true" to your view, it will automatically get "fullscreen" :) 文章来源: android videoview scalemode

Navigation Drawer and VideoView in android

匿名 (未验证) 提交于 2019-12-03 01:33:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using a navigation drawer plus a tablayout. I have a video in my tab which was not visible at first, but I can hear the sound. Once I set video_view.setZOrderOnTop(true); and I can also see the video, but this causes an issue with navigation drawer. When I slide it, the video doesn't hide behind the navigation drawer as do all other elements. If I don't use video_view.setZOrderOnTop(true); then my drawer is works fine. main_activity.xml <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"

Android Context Memory Leak ListView due to AudioManager

匿名 (未验证) 提交于 2019-12-03 01:32:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a ListView and I would expect it to be cleared from memory when the activity finishes. However, it appears that it is leaking. When I check the Memory Dump, and get the pathToGC for the ListView I get the following, Class Name | Shallow Heap | Retained Heap android . widget . ExpandableListView @ 0x4063e560 | 768 | 39 , 904 |- list , mList com . hitpost . TeamChooser @ 0x405f92e8 | 176 | 1 , 648 | '- mOuterContext android.app.ContextImpl @ 0x40657368 | 160 | 304 | ' - mContext android . media . AudioManager @ 0x40662600 | 40

MediaPlayer object getting Null after orientation change?

匿名 (未验证) 提交于 2019-12-03 01:26:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am trying to do video streaming that is working fine in portrait mode. Then I added code for onConfigurationChange to inflate another layout for landscape mode. but my app is getting crashed at this line: int timeElapsed = mediaPlayer . getCurrentPosition (); Here I am getting mediaPlayer as null while it has been already initialized. MediaPlayer mediaPlayer ; public void onCreate ( final Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ); setContentView ( R . layout . activity_detailvideo ); context = this ;