3

Can any one How to play youtube videos on j2me java MIDlet? I want to play videos from Rss Feed? My Input URL: http://teluguone.com/tmdb/videos/Chinna-Smokes-Cigarette--Fabulous-Comedy-9533.html

String
  • 3,660
  • 10
  • 43
  • 66
  • The url you provided is not an RSS feed. If it where you would have a channel tag in it. – Telmo Pimentel Mota Jul 18 '12 at 11:48
  • Sorrry,from the RSS feed Url only i got "http://teluguone.com/tmdb/videos/Chinna-Smokes-Cigarette--Fabulous-Comedy-9533.html" this Url need to play on device – String Jul 19 '12 at 08:33
  • When you click on YouTube button (on right down corner of the video) you are taken to the video original URL http://www.youtube.com/watch?v=zqpAkb5TdXo&feature=player_embedded Try to open this other URL with javax.microedition.media.Manager.createPlayer – Telmo Pimentel Mota Jul 19 '12 at 11:54
  • yaa ,I tried to open the youtube original URL to the Manager.createPlayer Method ,but i am facing the below Exception javax.microedition.media.MediaException: Invalid locator: http://www.youtube.com/watch?v=zqpAkb5TdXo&feature=player_embedded – String Jul 19 '12 at 17:36
  • Please try to open the YouTube URL with MIDlet.platformRequest. It should open the handset browser and, if the handset is capable, play the video. – Telmo Pimentel Mota Jul 19 '12 at 17:49
  • yaaa,I used Midlet PlatformRequest To open the Youtube video,it is asking,u need Flashmedia or Html5 to open this video in series 40 device – String Jul 20 '12 at 04:12
  • According to http://www.developer.nokia.com/Community/Wiki/How_to_play_video_streaming_in_Java_ME you can use rtsp protocol with you tube http://en.wikipedia.org/wiki/Real_Time_Streaming_Protocol. Please, give it a try. – Telmo Pimentel Mota Jul 20 '12 at 11:27
  • Hii,ya i tried for RTSP Protocol,it is Succeesfully Streaming and Playing in j2me(java),Can we able to Stream HttpProrocol (.Mp4) youTube Videos,Itried it for Nokia SDK 1.1 and Nokia Symbian Belle SDK 1.0 Device.it is giving the Exception,cannot create player for the provided url,i want to Stream and play the video "http://teluguone.com/tmdb/videos/Chinna-Smokes-Cigarette--Fabulous-Comedy-9533.html%22" – String Jul 21 '12 at 06:29
  • Please provide your rtsp url. – Telmo Pimentel Mota Jul 22 '12 at 16:59
  • Actually,i dont have any requirement to play RTSP URL streaming,i just have taken sample RTSP url from youtube mobile Site "m.youtube.com" and i tried to play,My actual requirement is to stream and play the http://teluguone.com/tmdb/videos/Chinna-Smokes-Cigarette--Fabulous-Comedy-9533.html url.... – String Jul 23 '12 at 05:07

1 Answers1

4

From the html page source code, search for the iframe tag with src pointing to http://www.youtube.com/embed/. The last part of the src url is the VIDEO_ID. For example, at http://www.youtube.com/embed/zqpAkb5TdXo URL VIDEO_ID is equal to zqpAkb5TdXo.

Open http://gdata.youtube.com/feeds/mobile/videos/VIDEO_ID and search the source code for media:content tags. These tags point to urls with type='video/3gpp' and rtsp protocol and can usually be opened by J2ME apps with Manager.createPlayer(url).

Telmo Pimentel Mota
  • 4,033
  • 16
  • 22
  • Hii,Thanks for Reply,I got your answer,But in j2me(java)can we do Http RealTime Video Streaming?and also In j2me any special Html parsers are available,why because all the available parser in j2se,Jsoup Parser,Html Parsrer,Jericho Html Parser are not working in j2me,I want to Extract the iframe tag and media:content tag information – String Jul 24 '12 at 05:23
  • Read the html page to memory, store it in a String and use indexOf and substring methods. You should be able to get the iframe tag this way. – Telmo Pimentel Mota Jul 24 '12 at 11:35
  • Hii Telmo Pimentel Mota, your answer is not working,now i dont know wt happend,i am not able to extract the RTSP link,when i try to open this url http://gdata.youtube.com/feeds/mobile/videos/zqpAkb5TdXo, i am facing problem,can you help me out......and ,once you check my Actual link,which is to be played on my Device,Here the link http://teluguone.com/tmdb/videos/Chinna-Smokes-Cigarette--Fabulous-Comedy-9533.html – String Jul 27 '12 at 09:23
  • Read the url content to an String object named htmlContent, then: int mediaIndex = htmlContent.indexOf(" – Telmo Pimentel Mota Jul 27 '12 at 11:10
  • thanks Telmo Pimentel Mota,But My Actual Problem is with this URL gdata.youtube.com/feeds/mobile/videos/zqpAkb5TdXo,some times the url is not opening in Brower,some times ,it is working,i checked it now,it is opening in my Brower,So my parsing code is working – String Jul 27 '12 at 11:59
  • You might have connectivity problems. When the YouTube url fails to load, does the main YouTube site also fails? – Telmo Pimentel Mota Jul 27 '12 at 15:14
  • Hii Telmo Pimentel Mota, when i try to parse this URL: http://gdata.youtube.com/feeds/mobile/videos/Nrz2vpww41s for RTSP Link ,My Code is giving Exception,after that When i try to open the above URL in browser,it is saying:you have chooosen to open Nrz2vpww41s this file which is a: application/atom+xml(1.2 KB) from:http://gdata.youtube.com what should firefox do with this file?,For this any alternate Solution? – String Jul 28 '12 at 08:21