BigintSolution / android-youtube-player

Automatically exported from code.google.com/p/android-youtube-player
0 stars 0 forks source link

can't play video using OpenYouTubePlayerActivity #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
 String url = "http://www.youtube.com/watch?v=w5fXOct6rJw";

        Uri uri = Uri.parse(url);
        String vid = uri.getQueryParameter("v"); 

        //Intent lVideoIntent = new Intent(null, Uri.parse(url), this,OpenYouTubePlayerActivity.class);

        Intent lVideoIntent = new Intent(null, Uri.parse("ytpl://"+ vid), this, OpenYouTubePlayerActivity.class);

        startActivity(lVideoIntent);

What is the expected output? What do you see instead?
I get Communication Error, also the logs shows 

09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870): Error occurred while 
retrieving information from YouTube.
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870): java.lang.NullPointerException
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870):     at 
java.net.URLDecoder.decode(URLDecoder.java:104)
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870):     at 
java.net.URLDecoder.decode(URLDecoder.java:48)
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870):     at 
com.keyes.youtube.YouTubeUtility.calculateYouTubeUrl(YouTubeUtility.java:133)
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870):     at 
com.keyes.youtube.OpenYouTubePlayerActivity$QueryYouTubeTask.doInBackground(Open
YouTubePlayerActivity.java:398)
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870):     at 
com.keyes.youtube.OpenYouTubePlayerActivity$QueryYouTubeTask.doInBackground(Open
YouTubePlayerActivity.java:1)
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870):     at 
android.os.AsyncTask$2.call(AsyncTask.java:185)
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870):     at 
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870):     at 
java.util.concurrent.FutureTask.run(FutureTask.java:138)
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870):     at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870):     at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870):     at 
java.lang.Thread.run(Thread.java:1019)
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870): Error playing video!
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870): java.lang.RuntimeException: 
Invalid NULL Url.
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870):     at 
com.keyes.youtube.OpenYouTubePlayerActivity$QueryYouTubeTask.onPostExecute(OpenY
ouTubePlayerActivity.java:431)
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870):     at 
com.keyes.youtube.OpenYouTubePlayerActivity$QueryYouTubeTask.onPostExecute(OpenY
ouTubePlayerActivity.java:1)
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870):     at 
android.os.AsyncTask.finish(AsyncTask.java:417)
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870):     at 
android.os.AsyncTask.access$300(AsyncTask.java:127)
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870):     at 
android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870):     at 
android.os.Handler.dispatchMessage(Handler.java:99)
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870):     at 
android.os.Looper.loop(Looper.java:123)
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870):     at 
android.app.ActivityThread.main(ActivityThread.java:3806)
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870):     at 
java.lang.reflect.Method.invokeNative(Native Method)
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870):     at 
java.lang.reflect.Method.invoke(Method.java:507)
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870):     at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870):     at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
09-17 01:27:02.416: ERROR/QueryYouTubeTask(5870):     at 
dalvik.system.NativeStart.main(Native Method)

What version of the product are you using? On what operating system?
2.3.3

Please provide any additional information below.

If i use below code it works

Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri
                        .parse("http://www.youtube.com/watch?v=s8I05iFWkQ0"));
                startActivity(myIntent);

Original issue reported on code.google.com by prasad.d...@gmail.com on 17 Sep 2011 at 5:41

GoogleCodeExporter commented 8 years ago
I got below error when i tried on emulator,I used below source code 
String url = "http://www.youtube.com/watch?v=Aqyf2aYR1pQ&feature=featured";

        Uri uri = Uri.parse(url);
        String vid = uri.getQueryParameter("v"); 
 Intent lVideoIntent = new Intent(null,Uri.parse("ytv://"+vid), this, IntroVideoActivity.class);

        startActivity(lVideoIntent);

09-17 22:43:04.529: DEBUG/dalvikvm(340): GC_CONCURRENT freed 100K, 69% free 
318K/1024K, external 0K/0K, paused 1ms+1ms
09-17 22:43:04.529: DEBUG/jdwp(340): adbd disconnected
09-17 22:43:04.569: INFO/AndroidRuntime(340): NOTE: attach of thread 'Binder 
Thread #3' failed
09-17 22:43:06.039: INFO/ARMAssembler(66): generated 
scanline__00000177:03515104_00001002_00000000 [ 87 ipp] (110 ins) at 
[0x445ed6f0:0x445ed8a8] in 646678 ns
09-17 22:43:06.259: INFO/ActivityManager(66): Starting: Intent { 
dat=ytv://Aqyf2aYR1pQ cmp=com.markana/com.keyes.youtube.IntroVideoActivity } 
from pid 348
09-17 22:43:06.880: INFO/ActivityManager(66): Displayed 
com.markana/com.keyes.youtube.IntroVideoActivity: +575ms (total +2s393ms)
09-17 22:43:09.169: DEBUG/MediaPlayer(348): Couldn't open file on client side, 
trying server side
09-17 22:43:09.179: INFO/StagefrightPlayer(34): 
setDataSource('http://www.youtube.com/get_video?video_id=Aqyf2aYR1pQ&t=vjVQa1Ppc
FMvhUQn_YNtbecfsl_w2vtzxxnZR6xCN6M%3D&fmt=18')
09-17 22:43:09.201: INFO/NuHTTPDataSource(34): connect to 
www.youtube.com:80/get_video?video_id=Aqyf2aYR1pQ&t=vjVQa1PpcFMvhUQn_YNtbecfsl_w
2vtzxxnZR6xCN6M%3D&fmt=18 @0
09-17 22:43:09.459: INFO/AwesomePlayer(34): mConnectingDataSource->connect() 
returned -1004
09-17 22:43:09.459: ERROR/MediaPlayer(348): error (1, -1004)
09-17 22:43:09.539: ERROR/MediaPlayer(348): Error (1,-1004)
09-17 22:43:09.539: DEBUG/VideoView(348): Error: 1,-1004

Can you guys let me know why media player is throwing -1004? so far no luck 
playing video with OpenYouTubePlayerActivity

Original comment by prasad.d...@gmail.com on 17 Sep 2011 at 10:46

GoogleCodeExporter commented 8 years ago
the original defect was not formatting the url correctly.  the 
openyoutubeplayer expects the url to be of the form ytv://<video-id>.  also, 
there were errors in the player interacting with the youtube apis that should 
now be fixed.

Original comment by keyes...@gmail.com on 4 Nov 2011 at 1:49

GoogleCodeExporter commented 8 years ago
The issue is not fixed, I am still getting the error with new jar, also i made 
code changes to use ytv

11-10 11:40:43.354: ERROR/QueryYouTubeTask(15812): Error playing video!
11-10 11:40:43.354: ERROR/QueryYouTubeTask(15812): java.lang.RuntimeException: 
Invalid NULL Url.
11-10 11:40:43.354: ERROR/QueryYouTubeTask(15812):     at 
com.keyes.youtube.OpenYouTubePlayerActivity$QueryYouTubeTask.onPostExecute(OpenY
ouTubePlayerActivity.java:418)
11-10 11:40:43.354: ERROR/QueryYouTubeTask(15812):     at 
com.keyes.youtube.OpenYouTubePlayerActivity$QueryYouTubeTask.onPostExecute(OpenY
ouTubePlayerActivity.java:1)
11-10 11:40:43.354: ERROR/QueryYouTubeTask(15812):     at 
android.os.AsyncTask.finish(AsyncTask.java:417)
11-10 11:40:43.354: ERROR/QueryYouTubeTask(15812):     at 
android.os.AsyncTask.access$300(AsyncTask.java:127)
11-10 11:40:43.354: ERROR/QueryYouTubeTask(15812):     at 
android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)
11-10 11:40:43.354: ERROR/QueryYouTubeTask(15812):     at 
android.os.Handler.dispatchMessage(Handler.java:99)
11-10 11:40:43.354: ERROR/QueryYouTubeTask(15812):     at 
android.os.Looper.loop(Looper.java:130)
11-10 11:40:43.354: ERROR/QueryYouTubeTask(15812):     at 
android.app.ActivityThread.main(ActivityThread.java:3859)
11-10 11:40:43.354: ERROR/QueryYouTubeTask(15812):     at 
java.lang.reflect.Method.invokeNative(Native Method)
11-10 11:40:43.354: ERROR/QueryYouTubeTask(15812):     at 
java.lang.reflect.Method.invoke(Method.java:507)
11-10 11:40:43.354: ERROR/QueryYouTubeTask(15812):     at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:840)
11-10 11:40:43.354: ERROR/QueryYouTubeTask(15812):     at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:598)
11-10 11:40:43.354: ERROR/QueryYouTubeTask(15812):     at 
dalvik.system.NativeStart.main(Native Method)

Original comment by prasad.d...@gmail.com on 10 Nov 2011 at 4:41

GoogleCodeExporter commented 8 years ago
I am also getting the same error.

11-15 18:22:41.446: ERROR/QueryYouTubeTask(1088): java.lang.RuntimeException: 
Invalid NULL Url. Not sure, how to fix it, I tried various combination but it 
fails at the same place saying, "Invalid Url"

Original comment by mukicha...@gmail.com on 15 Nov 2011 at 12:55

GoogleCodeExporter commented 8 years ago
Same here.  The developer says it was fixed on Nov 4, 2011 but no new jar 
posted to site.  The latest one is from Nov 1, 2011 which is before this bug 
was reported.  If this issue is fixed, we need the new jar!

Original comment by naushad....@gmail.com on 20 Jan 2012 at 2:14

GoogleCodeExporter commented 8 years ago
By the way, it works when on Wifi.  I looked at the source and can't figure out 
why might be wrong.

Original comment by naushad....@gmail.com on 20 Jan 2012 at 2:14

GoogleCodeExporter commented 8 years ago
I patched the source and provided an update that works.  

Instructions:
1) Load the jar into your project

2) Add to your manifest file:

<activity            
android:name="com.controlledsenility.android.youtube.OpenYouTubePlayerActivity"
android:configChanges="orientation"
/>

3) Call the activity the same way as before:

String url = "http://www.youtube.com/watch?v=yourvideoid";
Uri uri = Uri.parse(url);
String videoId = uri.getQueryParameter("v");
Intent videoIntent = new Intent(null, Uri.parse("ytv://" + videoId), 
this,OpenYouTubePlayerActivity.class);
startActivity(videoIntent);

Original comment by naushad....@gmail.com on 20 Jan 2012 at 10:12

GoogleCodeExporter commented 8 years ago
You can use the regular source if you dont want to use my jar.  Attached is the 
activity I edited (source attached).  Just drop the java into your project in 
place of the original and rebuild.

Original comment by naushad....@gmail.com on 25 Jan 2012 at 10:05

Attachments:

GoogleCodeExporter commented 8 years ago
Issue seems to still occur on Android 2.2 and 2.3

Original comment by Danny.S...@gmail.com on 30 Jan 2012 at 4:18

GoogleCodeExporter commented 8 years ago
i tried running the code but i keep getting the below error:

03-05 13:47:05.590: E/QueryYouTubeTask(9413): Error occurred while retrieving 
information from YouTube.

Does anyone have a clue about it?

Original comment by Aniket.B...@gmail.com on 5 Mar 2012 at 8:24

GoogleCodeExporter commented 8 years ago
My test Video url is http://www.youtube.com/watch?v=v_gQHtXsLtU.

and go down into the stack I found @ queryLatestPlaylistVideo() in 
YouTubeUtility.java, line 62 the lResp is a HTTP 404 NOT FOUND. So the real 
youtube link must be changed by now. 

the url must be change over time. Is there more consitent way of this?

Original comment by robertwa...@gmail.com on 7 Mar 2012 at 10:48

Attachments:

GoogleCodeExporter commented 8 years ago
btw the lGetMethod uri string is: 
http://gdata.youtube.com/feeds/api/playlists/v_gQHtXsLtU?v=2&max-results=50&alt=
json

Original comment by robertwa...@gmail.com on 7 Mar 2012 at 10:50

GoogleCodeExporter commented 8 years ago
what's the valid url really???

Original comment by robertwa...@gmail.com on 7 Mar 2012 at 10:53

GoogleCodeExporter commented 8 years ago
Have you got a solution for this yet? I am in the same situation

Original comment by reneab...@gmail.com on 3 Apr 2012 at 11:28

GoogleCodeExporter commented 8 years ago
Can you help me?

Original comment by wade...@gmail.com on 24 Apr 2012 at 2:51

Attachments:

GoogleCodeExporter commented 8 years ago
This is returned by the server,Every time I can not share the video to the 
server,I need help.Thank you 

Original comment by wade...@gmail.com on 24 Apr 2012 at 2:55

Attachments:

GoogleCodeExporter commented 8 years ago
is it working any way i have tired several times it didnt work

Original comment by shiakfar...@gmail.com on 5 Aug 2012 at 9:01

GoogleCodeExporter commented 8 years ago
OpenYouTubeActivity-1.2.jar  work perfects, make sure the URI, "ytv://", not 
the "ytpl://"

Original comment by th.hie...@gmail.com on 12 Aug 2012 at 8:49

GoogleCodeExporter commented 8 years ago
got this error:
 "An error occurred during the retrieval of the video.  This could be due to network issues or YouTube protocols.  Please try again later."

im using the 1.2 jar file.
HELP!!

Original comment by oshri...@gmail.com on 22 Aug 2012 at 8:23

GoogleCodeExporter commented 8 years ago
Post your code here

Original comment by iunlockb...@gmail.com on 23 Aug 2012 at 1:52

GoogleCodeExporter commented 8 years ago
thats my code:

                String url = "http://www.youtube.com/watch?v=IuEPADM2yBI";

                 Uri uri = Uri.parse(url);
                 String id = uri.getQueryParameter("v");

                Intent lVideoIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("ytv://" + id), YouTube.this,      OpenYouTubePlayerActivity.class);
                startActivity(lVideoIntent);

Original comment by oshri...@gmail.com on 23 Aug 2012 at 11:56

GoogleCodeExporter commented 8 years ago
This also not working :(
Is this working?

Original comment by murali....@gmail.com on 12 Oct 2012 at 6:13

GoogleCodeExporter commented 8 years ago
It says "Sorry, this video cannot be played"

Original comment by murali....@gmail.com on 12 Oct 2012 at 6:26

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Resolved this issue by adding Signature to the URL

fix:
VideoStream.java (Line: 30)
change: mUrl = lArgMap.get("url");
to:  mUrl = lArgMap.get("url") + "&signature=" + lArgMap.get("sig");

Original comment by srikanth...@gmail.com on 17 Oct 2012 at 9:25

GoogleCodeExporter commented 8 years ago
i did that but i still get the error 1,403, it says i can't play the video

Original comment by PieterTi...@gmail.com on 19 Oct 2012 at 8:29

GoogleCodeExporter commented 8 years ago
HI, i have a all the embed urls of my you tube 
http://www.youtube.com/embed/ydk9WBianNw

in my data base how can i play all these videos in my android application using 
video view,

thanks in advance

Original comment by venkat.r...@gmail.com on 30 Oct 2012 at 6:16

GoogleCodeExporter commented 8 years ago
that was not fixed, i still have the same issu with some video

Original comment by suissi.h...@gmail.com on 30 Nov 2012 at 11:20

GoogleCodeExporter commented 8 years ago
Thank for Srikanth. This problem is fixed. Thank again 

Original comment by kiencuon...@gmail.com on 7 Jan 2013 at 10:16

GoogleCodeExporter commented 8 years ago
#25 - thank you srikanth! that did the trick!

Original comment by lorenz.l...@gmail.com on 26 Mar 2013 at 11:20

GoogleCodeExporter commented 8 years ago
Hi,

How can I edit this?

mUrl = lArgMap.get("url") + "&signature=" + lArgMap.get("sig");

when I try to edit it from the eclipse, it can't be edited.

Hope to help me to edit it.

Original comment by m96...@gmail.com on 29 Mar 2013 at 11:38

GoogleCodeExporter commented 8 years ago
How can play the mp4 formate videos.i got an error when i try to load the mp4 
formate youtube video.please help he some one...

Original comment by rambabu1...@gmail.com on 12 Jul 2013 at 5:52

GoogleCodeExporter commented 8 years ago
Hi,
I don't get how to change VideoStream.java (Line: 30)?
How i can even acess this file,i got only the jar without the code?

Thanks

Original comment by katznels...@gmail.com on 30 Jul 2013 at 8:49

GoogleCodeExporter commented 8 years ago
#25 srikanth...@gmail.com
Resolved this issue by adding Signature to the URL

fix:
VideoStream.java (Line: 30)
change: mUrl = lArgMap.get("url");
to:  mUrl = lArgMap.get("url") + "&signature=" + lArgMap.get("sig");

Yes, it work perfectly. Thank bro

Original comment by lazico...@gmail.com on 11 Oct 2013 at 8:43

GoogleCodeExporter commented 8 years ago
An error occurred during the retrieval of video. This could be due to network 
issues or YouTube protocols. Please try again later.

Original comment by a...@virtualheight.com on 23 Dec 2013 at 9:18

GoogleCodeExporter commented 8 years ago
I fixed it using the #25 srikanth…@gmail.com suggestion. I'm attaching a new 
JAR.

Original comment by tangamam...@gmail.com on 27 Jan 2014 at 8:21

Attachments:

GoogleCodeExporter commented 8 years ago
Please do anybody no why the videoview is small. The video aint going full 
screen

Original comment by gasforr...@gmail.com on 18 Feb 2014 at 9:25

Attachments:

GoogleCodeExporter commented 8 years ago
1.3 works, however, it only works with some videos.  I've seen elsewhere that 
suggested only videos that are explicitly marked as available for mobile will 
work with this.  

Original comment by andrew.f...@gmail.com on 20 Aug 2014 at 2:12