0

This is link for video:

http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4

In manifest:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.videostart">

    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

This is code for playing this video:

package com.example.videostart;

import androidx.appcompat.app.AppCompatActivity;

import android.net.Uri;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.VideoView;

public class MainActivity extends AppCompatActivity {

    VideoView videoView;
    MediaController mediaController;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        videoView = findViewById(R.id.videoView);
        String link = "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4";
        Uri video = Uri.parse(link);
        mediaController = new MediaController(this);      
        videoView.setVideoURI(video);
        mediaController.setAnchorView(videoView);
        videoView.setMediaController(mediaController);
        videoView.start();
 }
}

But the video does no play. Please, tell me, there is a mistake?

enter image description here

Ruslan
  • 23
  • 4
  • 1
    Does this answer your question? [Android Studio - VideoView only plays videos witth https and not http](https://stackoverflow.com/questions/59220761/android-studio-videoview-only-plays-videos-witth-https-and-not-http) – greeble31 Jan 30 '20 at 21:09
  • @greeble31 Yes, it is! Thank you so much! – Ruslan Feb 01 '20 at 15:24

0 Answers0