android-videoview

How to get the Height of the VideoView included in the Activity

时间秒杀一切 提交于 2019-12-08 04:02:43
问题 I need to get the Height of the VideoView of my activity in android, I am using the following commands, but it gives me the Height as 0. VideoView vv = (VideoView)findViewById(R.id.video1); String surl="SOME_LINK.mp4"; Uri uri=Uri.parse(surl); MediaController mc = new MediaController(this); vv.setVideoURI(uri); vv.setMediaController(mc); mc.setMediaPlayer(vv); mc.setAnchorView(vv); int vvHeight=vv.getMeasuredHeight(); Log.d("VideoView Height:",vvHeight+""); // The Logcat output : 0. int

sorry, this video cannot be played in videoview?

半腔热情 提交于 2019-12-08 03:37:58
问题 freinds, i am using following code to display a mp4 video in my application and facing following problems i have seen so many posts related to this issue on google and stackoverflow but every one giving his own suggestions and there is no common answer. 1) i cannot see video in emulator 2) in different phone sometime rarly video is played and most of the time it give above message. my code VideoView myVideoView = (VideoView)findViewById(R.id.videoview); String viewSource ="http://dev.hpac.dev

VideoView SeekTo working abnormally on different devices - Android

て烟熏妆下的殇ゞ 提交于 2019-12-07 18:14:40
问题 I am using this code on video view to seek to custom position but it is working fine on samsung devices but on sony devices the video seeks to the start position(beginning) I want to get video to the position where it was last time paused Creating Video View: VideoView mVideoPlayer.setVideoPath(ViDpath); MediaController mCd = new MediaController(this); mVideoPlayer.setMediaController(mCd); mVideoPlayer.requestFocus(); Pause and Play works fine: mVideoPlayer.pause(); mVideoPlayer.start(); This

I want to get the video size in MB from videoview from internet path

空扰寡人 提交于 2019-12-07 13:37:01
问题 I'm trying to get the video file size and display it in the layout before starting the video. I have tried many thing but it wont work video_player_view = (VideoView) findViewById(R.id.videoView2); media_Controller = new MediaController(this); dm = new DisplayMetrics(); this.getWindowManager().getDefaultDisplay().getMetrics(dm); int height = dm.heightPixels; int width = dm.widthPixels; try { video_player_view.setMinimumWidth(width); video_player_view.setMinimumHeight(height); } catch

Android: What video format/encoding should I use to support most of the android devices

蓝咒 提交于 2019-12-07 13:25:14
问题 I have a collection of video clips which user should be able play from inside my app (not external video player). I am using VideoView with MediaController. Everything works as expected on my Desire HD and Nexus S (both running Android 2.3.3). However they won't play on order devices. I get "Sorry, this video cannot be played" error message. All videos are mp4, encoded with H.264, 720w/480h, 25fps . I have also used H.263(3gp) but with no luck. I want to support as many Android devices as

Issue displaying thumbnail image in VideoView

天涯浪子 提交于 2019-12-07 13:00:08
问题 I'm using VideoView for a web video, and I also have a bitmap object contains the corresponding thumbnail image. Now how should I set the bitmap to the VideoView for displaying the thumnail? I'm using videoView.setBackgroundDrawable(new BitmapDrawable(getResources(), bitmap)); But then when I play this video, the video doesn't show, instead it always show this static thumbnail image. Any hints would be appreciated. Thanks. 回答1: VideoView is a subclass of SurfaceView , which has some special

Retained Fragment Not Retained

这一生的挚爱 提交于 2019-12-07 07:31:10
问题 I have a simple layout containing a VideoView. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@color/black" android:gravity="center" > <VideoView android:id="@+id/videoPlayer" android:layout_width="fill_parent" android:layout_height="fill_parent"/> </RelativeLayout> The Activity that uses this layout creates a Fragment to start the VideoView public class VideoPlayerActivity

How to play rtmp video in videoview in android?

百般思念 提交于 2019-12-07 07:30:41
问题 I want to play rtmp video in videoview , so how i can play rtmp video in my app? String host = "rtmp://example.com"; String fileName = "www.mp4"; int port = 1935; Connection string rtmp://example/cfx/st How i can play video ? Regards, girish 回答1: You can do it using Flash (at least for devices with 2.2+ android and Flash-supported CPUs) http://www.wowza.com/forums/showthread.php?13087-Android-RTMP-Live-Streaming The easiest way to play an audio RTMP stream in Android 来源: https://stackoverflow

Android VideoView live tv stream (HLS)

只谈情不闲聊 提交于 2019-12-07 07:28:46
问题 I'am trying to develop app for tv streaming (HLS). Using code below I tested stream on 2.3.3, 3.0 and 4.0.1 version Android devices, but encountered several problems. On Android 2.3.3 stream plays for >1 minute and then just stops. On Android 3.0 it plays well and on Android 4.0.3 it displays message 'This file cannot be played' (if I remember correctly). So my question would be: How can I play stream on ether of these devices, without having stream playing problems? Or where can I read more

How to automatically play video in listview on android app

大城市里の小女人 提交于 2019-12-07 05:17:08
问题 I want to play video in listview from online server as like VINE app. And plays only one video at a time.But videoview cann't show in listview. I can view all others like text, links. But VideoView cann't show in listview row. show all without videoview. when try without listview it works fine and play video from online my listview adapter code snippet like this: mViewHolder.mVideoView.setVisibility(View.VISIBLE); MediaController mComtroller = new MediaController(mContext); mViewHolder