android-video-player

surfaceview playing video as stretched view

二次信任 提交于 2019-12-12 09:24:13
问题 I am using the mediaplayer.xml to play the video file <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/MainView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#4d4d4d" android:gravity="center" android:keepScreenOn="true" android:orientation="vertical" > <SurfaceView android:id="@+id/surfaceView" android:layout_width="fill_parent" android:layout_height="wrap_content"

Android's MediaPlayer setSurface while on paused state

喜夏-厌秋 提交于 2019-12-12 08:49:52
问题 EDIT : So apparently this has nothing to do with multiple activities, and this has something to do with the encoding of the video file. I will try to simplify the question: I have a MediaPlayer object in a paused state, when I call mediaPlayer.getCurrentPosition() I get a result which is accurate. When I call mediaPlayer.setSurface() (using a different surface) followed by mediaPlayer.play() on this object the video is played in a different position than the one returned by getCurrentPosition

Android MediaExtractor crash when decoding some mp4 files. Libc fatal signal 11

血红的双手。 提交于 2019-12-12 04:17:07
问题 I am using Google Grafika examples to display video on TextureView. "Double decode" to be more specific . Code work most of the time but for some mp4 files it crash giving only : libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 7998 Same code works for webM files and most mp4 files. Place where I expect it to fail is : extractor = new MediaExtractor(); extractor.setDataSource(sourceFile); in MoviePlayer [L:113] Any hint how to walk around or what might be the problem? 回答1: This

Video player not working - Android Studio

☆樱花仙子☆ 提交于 2019-12-12 02:05:10
问题 I am trying to add a video played on button click with android studio. However, when I click the button a "sorry, this video cannot be played" message box appears on the emulator screen. Can you help me see where I'm going wrong. Below is the code I approached the goal with Trialvideo.java package android.com.trialvideo; import android.app.Activity; import android.graphics.PixelFormat; import android.media.MediaPlayer; import android.net.Uri; import android.os.Bundle; import android.view.View

Video Player Null Pointer Exception using Google Media Framework Exoplayer

我的梦境 提交于 2019-12-11 10:34:20
问题 I am using GMF sample to play Video in my app, where I am fetching video title and url from live JSON, here is the sample of my JSON : { "videos": [ { "title":"Video 1", "url":"88.mp4" }, { "title":"Video 2", "url":"l5.mp4" } ]} And this is what my code looks like : MainActivity.java: JSONObject jsono = new JSONObject(data); JSONArray jarray = jsono.getJSONArray("videos"); for (int i = 0; i < jarray.length(); i++) { JSONObject object = jarray.getJSONObject(i); Videos video = new Videos();

How can we cache HLS video url once streamed

帅比萌擦擦* 提交于 2019-12-10 21:35:39
问题 I am using exomedia library to play video through hls. I want to cache video as the video gets streamed. AndroidVideoCache library do this job well but it doesn't support HLS . 回答1: It can be done by configuring the okhttp client used by the Exomedia library. First we need provide custom renderbuilder to emvideoview by using setVideoUri(uri,renderbuilder) method. In order to provide custom hls render builder we need to override HlsRenderBuilder class and override createDataSource method. Here

Android Video Stream upload to php server?

懵懂的女人 提交于 2019-12-10 11:26:50
问题 HI, Anyone suggest some sample and idea to post the video data to server.I want to playback the video later as stream video from the server directly.Anyone suggest me how to upload the stream video to php server and playback it as stream video from server. 回答1: muniir@msn.com wrote: public class SocialHTTPPost { public static byte[] getCapturedImageStream(Context ctx, Intent data) { String fileName = ((MainActivity) ctx).mCaptureImageHMap.get("name").toString(); int mid= fileName.lastIndexOf(

Android:video as splash screen

ε祈祈猫儿з 提交于 2019-12-09 16:57:32
问题 I want to play the video as splash screen.I have implement the play video but it show the default control like play,pause and seek etc.I want to remove the so that the after video finish I need to call the new activity. MediaController mc = new MediaController(this); getWindow().setFormat(PixelFormat.TRANSLUCENT); video.setMediaController(mc); video.setVideoURI(uri); video.setOnCompletionListener(this); video.setOnTouchListener(new OnTouchListener() { public boolean onTouch(View arg0,

how can i play two video on one screen?

我们两清 提交于 2019-12-09 07:58:49
问题 i have to make an application where i need to play two video simultaniously,on screen. here is my code.but the video dose not play.am i doing wrong anywhere? :( public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); VideoView myVideoView = (VideoView)findViewById(R.id.myvideoview); myVideoView.setVideoURI(Uri.parse(SrcPath)); myVideoView.setMediaController(new MediaController(this)); myVideoView.requestFocus(); myVideoView.start();

How do use a MediaPlayer to a SurfaceView in a Fragment

﹥>﹥吖頭↗ 提交于 2019-12-08 19:53:06
问题 Because I want to be able to pass the MediaPlayer that plays the video around, I want to use a SurfaceView instead of a VideoView inside my fragment that plays the video. I looked at an earlier question about how to attach the MediaPlayer to the SurfaceView. The answer to the question tells me to create two functions: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_player); getWindow().setFormat(PixelFormat