-1

I'm developing a TV App in android, which need to cast a video on TV netflix, but I have to do that without logged account on netflix tv app. Is it possible?

Rodrigo Salomao
  • 143
  • 1
  • 10
  • Have you tried it? – Adonis Aug 09 '17 at 12:42
  • Yes I did. But I send the link to app and it require me to log in first. The problem many ppl will use the app, I can´t leave a account on it and had to erase the previous user data. Idk how to solve it. – Rodrigo Salomao Aug 09 '17 at 19:01

1 Answers1

1

After digging deep on stackoverflow I found a ticket that solve my problem: Movie Deeplink for Netflix Android TV app (com.netflix.ninja) Congrats for @Jeroen Ost that post the solution.

I still had to work with netflix version. The one that worked for me was ninja 3.3.1. BE AWARE.

Bellow the class that cast any kind of link that has share on the third party aplication.

public void openUrl(String url){

            Pattern p = Pattern.compile("www[.]netflix.*?[0-9]+");

            Matcher matcher = p.matcher(url);
            Intent webIntent = new Intent(Intent.ACTION_VIEW);
            if(matcher.find()){
                url = matcher.group();
                url = url.replace("title", "watch");
                url="http://"+url;

                webIntent.putExtra("source","30"); // careful: String, not int
    //            netflix.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_CLEAR_TASK);
            }
            webIntent.setData(Uri.parse(url));
            webIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            Log.i(TAG,"Cast URL: "+url);
            try {
                startActivity(webIntent);
            } catch (ActivityNotFoundException ex) {
                Log.i(TAG, "can't start Activity");
                Log.e(TAG, ex.getMessage());
            }


        }
Rodrigo Salomao
  • 143
  • 1
  • 10