android-video-player

Android SDK: Media Player - Load video stream from HTTP url

╄→尐↘猪︶ㄣ 提交于 2019-12-01 07:40:43
I have a MediaPlayerActivity with the following code: This code basically tries to get a video stream from a http url and load it but for some reason it keeps crashing. public class MediaPlayerActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.video_player); SurfaceView v = (SurfaceView) findViewById(R.id.surface_video); SurfaceHolder holder = v.getHolder(); holder.setFixedSize(400,300); MediaPlayer mp = MediaPlayer.create(this, Uri.parse("http://stream-url.com/playlist.m3u8")); mp.setDisplay

get video duration from URL in android app

大兔子大兔子 提交于 2019-12-01 07:36:32
I'm working on an app where the user can see all the video's information and title that are stored on a SERVER. I'm almost done with it except that no matter how I code it, I cannot get the video duration from a given URL. Lets take this demo video from somewhere on the internet: CLICK HERE FOR VIDEO PATH I want the app to get the video duration without the need to open the video itself. The Code that I'm trying to use on android is this: MediaMetadataRetriever retriever = new MediaMetadataRetriever(); retriever.setDataSource("https://12-lvl3-pdl.vimeocdn.com/01/1386/0/6932347/10573836.mp4

How to play Live Streaming video in Android

爷,独闯天下 提交于 2019-12-01 06:12:26
问题 In my project I have a requirement to play live streaming video. I have seen many comments that "live streaming is supported only from 3.0" so that I have to use emulator 3.0. But it does not play. Can anybody help for me.. This is my code: String SrcPath="http://akamedia2.lsops.net/live/smil:cnbc_en.smil/playlist.m3u8"; myVideoView = new VideoView(this); myVideoView.setVideoURI(Uri.parse(SrcPath)); setContentView(myVideoView); myVideoView.setMediaController(new MediaController(this));

get video duration from URL in android app

自闭症网瘾萝莉.ら 提交于 2019-12-01 05:11:16
问题 I'm working on an app where the user can see all the video's information and title that are stored on a SERVER. I'm almost done with it except that no matter how I code it, I cannot get the video duration from a given URL. Lets take this demo video from somewhere on the internet: CLICK HERE FOR VIDEO PATH I want the app to get the video duration without the need to open the video itself. The Code that I'm trying to use on android is this: MediaMetadataRetriever retriever = new

Android SDK: Media Player - Load video stream from HTTP url

我只是一个虾纸丫 提交于 2019-12-01 05:07:12
问题 I have a MediaPlayerActivity with the following code: This code basically tries to get a video stream from a http url and load it but for some reason it keeps crashing. public class MediaPlayerActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.video_player); SurfaceView v = (SurfaceView) findViewById(R.id.surface_video); SurfaceHolder holder = v.getHolder(); holder.setFixedSize(400,300);

Android Media Player Error (100,0)

让人想犯罪 __ 提交于 2019-12-01 04:44:38
I have read all the error codes given on the web. Error specifies: const PVMFStatus PVMFInfoLast = 100; " Placeholder for end of range" But I didn't able to handle this error, thanks for helping. Implement OnErrorListener to your class. inside the class body write video_view.setOnErrorListener(this); then overwrite the method OnError(MediaPlayer mp , int what , int extra) with this method @Override public boolean onError(MediaPlayer mp, int what, int extra) { if (what == 100) { video_view.stopPlayback(); Intent inn = new Intent(HelloInterruptVideoStream.this,TabAct.class); startActivity(inn);

how to get video thumb nail from raw folder video on android

大城市里の小女人 提交于 2019-12-01 04:40:06
in my app i need to display video thumb nail which is stored in res/raw folder. i searched regard it. i get the following code. int id = **"The Video's ID"** ImageView iv = (ImageView ) convertView.findViewById(R.id.imagePreview); ContentResolver crThumb = getContentResolver(); BitmapFactory.Options options=new BitmapFactory.Options(); options.inSampleSize = 1; Bitmap curThumb = MediaStore.Video.Thumbnails.getThumbnail(crThumb, id, MediaStore.Video.Thumbnails.MICRO_KIND, options); iv.setImageBitmap(curThumb); by this code i get video thumb nail from sdcard. but video from res/raw folder it

Android Media Player Error (100,0)

痞子三分冷 提交于 2019-12-01 02:47:09
问题 I have read all the error codes given on the web. Error specifies: const PVMFStatus PVMFInfoLast = 100; " Placeholder for end of range" But I didn't able to handle this error, thanks for helping. 回答1: Implement OnErrorListener to your class. inside the class body write video_view.setOnErrorListener(this); then overwrite the method OnError(MediaPlayer mp , int what , int extra) with this method @Override public boolean onError(MediaPlayer mp, int what, int extra) { if (what == 100) { video

how to get video thumb nail from raw folder video on android

♀尐吖头ヾ 提交于 2019-12-01 01:35:16
问题 in my app i need to display video thumb nail which is stored in res/raw folder. i searched regard it. i get the following code. int id = **"The Video's ID"** ImageView iv = (ImageView ) convertView.findViewById(R.id.imagePreview); ContentResolver crThumb = getContentResolver(); BitmapFactory.Options options=new BitmapFactory.Options(); options.inSampleSize = 1; Bitmap curThumb = MediaStore.Video.Thumbnails.getThumbnail(crThumb, id, MediaStore.Video.Thumbnails.MICRO_KIND, options); iv

how to implemenent android video player in full screen

筅森魡賤 提交于 2019-11-30 21:39:58
i have implemented android video player , but i don't need like this how i need mean when opening activity i need to pay video half screen in center when i click button full screen button then i need t pay in full screen , how to implement it help me.... VideoPlayerActivity public class VideoPlayerActivity extends Activity implements SurfaceHolder.Callback, MediaPlayer.OnPreparedListener, VideoControllerView.MediaPlayerControl { SurfaceView videoSurface; MediaPlayer player; VideoControllerView controller; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate