Launching the Android Netflix App and Transferring the Video ID

In the application I'm working on, I want to support Netfilx streams. I intend to do this by simply starting Netflix and passing a specific URI so that it runs a specific video at startup. Just? Well, the problem is that I'm not sure how to convey the video image information in the intent that I use to start the Activity.

I read the post here , but don't know where to use it. I used Intent.setData () as it accepts a URI, but to no avail.

Here is what I did (I hardcode the movie data, this is for testing purposes only):

// the Netflix intent Intent intent = getPackageManager().getLaunchIntentForPackage("com.netflix.mediaclient"); //the uri Uri uri = Uri.parse("http://movies.netflix.com/WiPlayer?movieid=70266228&trkid=13462049&ctx=0%2C1%2Ce2bd7b74-6743-4d5e-864f-1cc2568ba0da-61921755"); intent.setData(uri); //launches but does not go to the video startActivity(intent); 

I also tried using the URI protocol in the link above like this:

 Uri uri = Uri.parse("nflx://movies.netflix.com/WiPlayer?movieid=70266228&trkid=13462049&ctx=0%2C1%2Ce2bd7b74-6743-4d5e-864f-1cc2568ba0da-61921755"); 

but I don’t see the video yet.

It seems to me that I am missing something simple here, although for this I had very little luck for Google, I could hardly find anything about launching the Netflix Android application from another application. Netflix developers have no information about this.

Does anyone have any suggestions on how I can do this or where should I look for documentation on this? Any help would be greatly appreciated. Many thanks!

+4
android android-intent android-activity netflix
source share
3 answers

Just some Android apps to help everyone.

Skype: "com.skype.raider", "com.skype.raider.Main"

Netflix: "Com.netflix.mediaclient", "com.netflix.mediaclient.ui.launch.UIWebViewActivity"

ESexplorer: "Com.estrongs.android.pop", "com.estrongs.android.pop.view.FileExplorerActivity"

Youtube: "Com.google.android.youtube", "com.google.android.youtube.HomeActivity"

Chrome: "Com.android.chrome", "com.google.android.apps.chrome.Main"

VLC: "org.videolan.vlc", "org.videolan.vlc.gui.MainActivity"

MBOXSettings: "Com.mbx.settingsmbox", "com.mbx.settingsmbox.SettingsMboxActivity"

+4
source share

I managed to do this. With the following code. First you need a movieId (or videoId) for netflix, and then create a URL to view.

 String netFlixId = "43598743"; // <== isn't a real movie id String watchUrl = "http://www.netflix.com/watch/"+netFlixId; 

Then with that intention

 try { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setClassName("com.netflix.mediaclient", "com.netflix.mediaclient.ui.launch.UIWebViewActivity"); intent.setData(Uri.parse(watchUrl)); startActivity(intent); } catch(Exception e) { // netflix app isn't installed, send to website. Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse(item.url)); startActivity(intent); } 

I have not tried with a TV show yet. But it works great. If you want to send a movie profile page. Send it to a URL formatted in this way.

 http://www.netflix.com/title/324982 

I also learned how to find the title .

 try { Intent intent = new Intent(Intent.ACTION_SEARCH); intent.setClassName("com.netflix.mediaclient", "com.netflix.mediaclient.ui.search.SearchActivity"); intent.putExtra("query", item.label); startActivity(intent); } catch(Exception e) { Toast.makeText(this, "Please install the NetFlix App!", Toast.LENGTH_SHORT).show(); } 
+3
source share

Here's how to run a movie from the ADB team for com.netflix.mediaclient

 adb shell am start -n com.netflix.mediaclient/.ui.launch.UIWebViewActivity -a android.intent.action.VIEW -d http://www.netflix.com/watch/60000724 

I still cannot find a way to do this for com.netflix.ninja (Netflix for Android TV)

+1
source share

All Articles