<commit_before>package io.github.powerinside.syncplay;

import android.app.ProgressDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.media.MediaMetadataRetriever;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.provider.OpenableColumns;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.NavUtils;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AlertDialog;
import android.util.Log;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.ToggleButton;

import com.google.android.exoplayer2.DefaultLoadControl;
import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.ExoPlayerFactory;
import com.google.android.exoplayer2.LoadControl;
import com.google.android.exoplayer2.PlaybackParameters;
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.Timeline;
import com.google.android.exoplayer2.source.TrackGroupArray;
import com.google.android.exoplayer2.trackselection.AdaptiveTrackSelection;
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
import com.google.android.exoplayer2.trackselection.TrackSelection;
import com.google.android.exoplayer2.trackselection.TrackSelectionArray;
import com.google.android.exoplayer2.trackselection.TrackSelector;
import com.google.android.exoplayer2.upstream.BandwidthMeter;
import com.google.android.exoplayer2.upstream.DefaultBandwidthMeter;
import com.mitment.syncplay.syncPlayClientInterface;

import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Stack;

public class videoPlayer extends FragmentActivity implements SurfaceHolder.Callback,
        UserListDialogFragment.Listener, MediaSourceDialogFragment.Listener {
    private Handler nothingHandler;

    String server;
    private int REQUEST_TAKE_GALLERY_VIDEO = 1;
    private static final int READ_EXTERNAL_STORAGE_FOR_MEDIA = 2;
    private static final int REQUEST_INVITE = 1;
    private Intent pickerProvider;
    private Handler userListHandler;
    private boolean isFullS;

    @Override
    public void onMediaSourceClicked(int position) {
        if (position == 0) {
            final EditText txtUrl = new EditText(this);
            txtUrl.setHint("http://www.example.com/somefile.mp4");
            final Context thisContext = this;
            new AlertDialog.Builder(this)
                    .setTitle("Enter video URL")
                    .setMessage("Enter a URL to a video file")
                    .setView(txtUrl)
                    .setPositiveButton("ok", new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int whichButton) {
                            String url = txtUrl.getText().toString();
                            try {
                                URL theUrl = new URL(url);
                                if (theUrl.getHost().toLowerCase().equals("youtube.com")) {
                                    new AlertDialog.Builder(thisContext)
                                            .setTitle("Not this time")
                                            .setMessage("Youtube links are not supported now.")
                                            .setPositiveButton("ok", null)
                                            .show();
                                } else {
                                    // all good, load up.
                                        Uri androidUri = new Uri.Builder()
                                                .scheme(theUrl.getProtocol())
                                                .authority(theUrl.getHost())
                                                .appendEncodedPath(theUrl.getPath().substring(1))
                                                .build();
                                    try {
                                        mService.setURL(androidUri.toString());
                                    } catch (IOException e) {
                                        e.printStackTrace();
                                    }

                                    final URL uri=new URL(androidUri.toString());

                                    class getRemoteFileStuff extends AsyncTask<URL, Void, Void> {

                                        @Override
                                        protected Void doInBackground(URL... urls) {
                                            try
                                            {
                                                HttpURLConnection ucon;
                                                ucon= (HttpURLConnection) urls[0].openConnection();
                                                ucon.connect();
                                                final String contentLengthStr=ucon.getHeaderField("Content-Length");
                                                long size;
                                                try {
                                                    size = (long) Long.parseLong(contentLengthStr);
                                                } catch (NumberFormatException e) {<commit_msg>Remove hint of youtube being supported<commit_after>package io.github.powerinside.syncplay;

import android.app.ProgressDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.media.MediaMetadataRetriever;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.provider.OpenableColumns;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.NavUtils;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AlertDialog;
import android.util.Log;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.ToggleButton;

import com.google.android.exoplayer2.DefaultLoadControl;
import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.ExoPlayerFactory;
import com.google.android.exoplayer2.LoadControl;
import com.google.android.exoplayer2.PlaybackParameters;
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.Timeline;
import com.google.android.exoplayer2.source.TrackGroupArray;
import com.google.android.exoplayer2.trackselection.AdaptiveTrackSelection;
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
import com.google.android.exoplayer2.trackselection.TrackSelection;
import com.google.android.exoplayer2.trackselection.TrackSelectionArray;
import com.google.android.exoplayer2.trackselection.TrackSelector;
import com.google.android.exoplayer2.upstream.BandwidthMeter;
import com.google.android.exoplayer2.upstream.DefaultBandwidthMeter;
import com.mitment.syncplay.syncPlayClientInterface;

import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Stack;

public class videoPlayer extends FragmentActivity implements SurfaceHolder.Callback,
        UserListDialogFragment.Listener, MediaSourceDialogFragment.Listener {
    private Handler nothingHandler;

    String server;
    private int REQUEST_TAKE_GALLERY_VIDEO = 1;
    private static final int READ_EXTERNAL_STORAGE_FOR_MEDIA = 2;
    private static final int REQUEST_INVITE = 1;
    private Intent pickerProvider;
    private Handler userListHandler;
    private boolean isFullS;

    @Override
    public void onMediaSourceClicked(int position) {
        if (position == 0) {
            final EditText txtUrl = new EditText(this);
            txtUrl.setHint("http://www.example.com/somefile.mp4");
            final Context thisContext = this;
            new AlertDialog.Builder(this)
                    .setTitle("Enter video URL")
                    .setMessage("Enter a URL to a video file")
                    .setView(txtUrl)
                    .setPositiveButton("ok", new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int whichButton) {
                            String url = txtUrl.getText().toString();
                            try {
                                URL theUrl = new URL(url);
                                if (theUrl.getHost().toLowerCase().equals("youtube.com")) {
                                    new AlertDialog.Builder(thisContext)
                                            .setTitle("Sorry")
                                            .setMessage("Youtube links are not supported.")
                                            .setPositiveButton("ok", null)
                                            .show();
                                } else {
                                    // all good, load up.
                                        Uri androidUri = new Uri.Builder()
                                                .scheme(theUrl.getProtocol())
                                                .authority(theUrl.getHost())
                                                .appendEncodedPath(theUrl.getPath().substring(1))
                                                .build();
                                    try {
                                        mService.setURL(androidUri.toString());
                                    } catch (IOException e) {
                                        e.printStackTrace();
                                    }

                                    final URL uri=new URL(androidUri.toString());

                                    class getRemoteFileStuff extends AsyncTask<URL, Void, Void> {

                                        @Override
                                        protected Void doInBackground(URL... urls) {
                                            try
                                            {
                                                HttpURLConnection ucon;
                                                ucon= (HttpURLConnection) urls[0].openConnection();
                                                ucon.connect();
                                                final String contentLengthStr=ucon.getHeaderField("Content-Length");
                                                long size;
                                                try {
                                                    size = (long) Long.parseLong(contentLengthStr);
                                                } catch (NumberFormatException e) {
{'fraction_non_alphanumeric': 0.07675018729709482, 'fraction_numerical': 0.004661616582036127, 'mean_word_length': 1.7485701212537177, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 104, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2560739', 'n_tokens_mistral': 2719, 'n_tokens_neox': 2638, 'n_words': 542}