2016-04-15 9 views
1

Ich habe das Video in einem Webview im Querformat-Modus angezeigt ..Video in WebView anzeigen Problem

Aber irgendwie das Video nicht den ganzen Bildschirm abdecken. Es gibt einen weißen Teil am unteren Rand des Videos, der ein bisschen nervig ist.

Ich habe versucht mit webview.getSettings(). SetUseWideViewPort (true); webview.getSettings(). SetLoadWithOverviewMode (true);

Aber sie scheinen es nicht zu beheben.

Wie mache ich das Video, das in einem WebView abgespielt wird, über den gesamten Gerätebildschirm?

+0

Vielleicht Link helfen Ihnen: http://stackoverflow.com/questions/15796661/android -webview-app-wont-lassen-video-player-go-full-screen –

+0

http://stackoverflow.com/questions/15768837/playing-html5-video-on-fullscreen-in-android-webview –

+0

Hallo @AbbasNikzad Ich schaue schon in das .. aber mein Video ist nicht HTML5, es ist ein Live Stream im MJPEG-Format – emenpy

Antwort

0

Wenn Ihr Video Livestream ist, brauchen Sie nicht webview!

Ich bevorzuge mit VitamioLibrary zu streamen und in Ihrer App zu zeigen!


Wenn Sie HLT ausführen (HTTP Live-Stream) auf Android 2.1 und höher können Sie die Vitamio Bibliothek verwenden.

Website unter: (http://www.vitamio.org/). Hier

ist Codebeispiel: Das Haupt Layout:

<LinearLayout android:id="@+id/LinearLayout01" 
      android:layout_height="fill_parent"   xmlns:android="http://schemas.android.com/apk/res/android" 
      android:paddingLeft="2px" android:paddingRight="2px" 
      android:paddingTop="2px" android:paddingBottom="2px" 
      android:layout_width="fill_parent" android:orientation="vertical"> 

      <io.vov.vitamio.widget.VideoView 
       android:layout_height="fill_parent" 
       android:layout_width="fill_parent" android:id="@+id/VideoView">    
      </io.vov.vitamio.widget.VideoView> 
</LinearLayout> 

der Klasse:

import io.vov.vitamio.widget.MediaController; 
import io.vov.vitamio.widget.VideoView; 
import android.app.Activity; 
import android.content.Intent; 
import android.net.Uri; 
import android.os.Bundle; 



public class LiveStrimingTestActivity extends Activity{ 

    VideoView videoView; 

    private void test_2(){ 
     String httpLiveUrl = "http://aj.lsops.net/live/aljazeer_en_high.sdp/playlist.m3u8"; 
     videoView = (VideoView) findViewById(R.id.VideoView); 
     videoView.setVideoURI(Uri.parse(httpLiveUrl)); 
     MediaController mediaController = new MediaController(this); 
     videoView.setMediaController(mediaController); 
     videoView.requestFocus(); 
     videoView.start(); 
    } 


    public void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.main); 
     test_2();    
    }  
} 
+0

Wie würde ich es verwenden .. können Sie mehr Details zur Verfügung stellen? Danke – emenpy

+0

schau dir meine Antwort nochmal an, ich habe sie bearbeitet. –

+0

Hallo Abbas, Vielen Dank für die hilfreiche Antwort. Haben Sie eine Möglichkeit, mit der ich Sie privat kontaktieren könnte, wie Skype? – emenpy