How can I use Jplayer for Youtube videos?

7,101 views
Skip to first unread message

Mehmet Demiray

unread,
Aug 1, 2011, 5:55:28 PM8/1/11
to jpl...@googlegroups.com
How can I play youtube videos? Can it automatically leach videos? Can you give me a code sample for it? Thanks and Regards.

Carlos Ruiz

unread,
Aug 1, 2011, 6:00:36 PM8/1/11
to jpl...@googlegroups.com
you mean just use YouTube to host the video files?

I would be interested to know that as well :)

Carlos
Vanderbilt University

--
You received this message because you are subscribed to the Google Groups "jPlayer: HTML5 Audio & Video for jQuery" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jplayer/-/WxD0LWRjiB4J.
To post to this group, send email to jpl...@googlegroups.com.
To unsubscribe from this group, send email to jplayer+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jplayer?hl=en.

Mark Panaghiston

unread,
Aug 1, 2011, 9:15:08 PM8/1/11
to jpl...@googlegroups.com
In  jPlayer 2.0.x dev patch I added the formats for FLV and FLA, for video and audio Flash FLV files. Before, you had to fool jPlayer into thinking it was an M4V/M4A file and the Flash would play it... But the HTML solution would get grumpy, so you had to use solution:"flash" to disable the HTML solution completely.

In the dev patch, you can now use the flv/fla format in the same way as any other format and jPlayer will figure it out. jPlayer knows that only the flash can play that format, so behaves accordingly.

In my local test area, I also have the HTML5 media that youtube can now deliver set up. So it either plays the WebM, the M4V or the FLV that youtube delivers.

I have not looked into using the RSS feeds or whatever it is required to get the URLs of the media. I cheated and looked at the media URLs in the browser developer tools and looked for the large media file being downloaded... And used that URL. After all, all jPlayer cares about is the media. The stuff to work out what the hell you are supposed to using for media will always be external and then give the right urls to jPlayer in the setMedia command.

Mehmet Demiray

unread,
Aug 2, 2011, 6:12:09 AM8/2/11
to jpl...@googlegroups.com
Did you get my question? I just asked the player can play automatically from youtube url? as http://www.youtube.com/watch?v=ndck03mVmJc

Mark Panaghiston

unread,
Aug 3, 2011, 9:44:32 PM8/3/11
to jpl...@googlegroups.com
Not automatically.

I was trying to say that jPlayer can play the media that youtube gives out. You need to get the URL of the media and then pass it to jPlayer.

Mehmet Demiray

unread,
Aug 5, 2011, 6:54:50 AM8/5/11
to jpl...@googlegroups.com
Will you develop it for youtube etc?

Mark Panaghiston

unread,
Aug 5, 2011, 8:28:15 AM8/5/11
to jpl...@googlegroups.com
I might develop a demo that gets the information from the RSS feeds and then instances jPlayer.

jPlayer itself will not do this though. It is like the playlists, they are managed by some external code, as building it into jPlayer is far too rigid.

Mark Panaghiston

unread,
Aug 5, 2011, 8:35:42 AM8/5/11
to jpl...@googlegroups.com

shades

unread,
Dec 19, 2011, 1:32:43 PM12/19/11
to jpl...@googlegroups.com
I'm able to get the url of an MP4 file from youtube or vimeo and then feed that into jplayer but the problem is it is based on a token system and the urls expire.  Is there anyway around this?

Pradeep Kadnor

unread,
Jan 31, 2014, 4:07:10 AM1/31/14
to jpl...@googlegroups.com
How to use youtube url in Jplayer?????

ROHIT RANJAN

unread,
Apr 15, 2014, 5:50:30 AM4/15/14
to jpl...@googlegroups.com
Hi Pradeep Kadnor,
      Although this post is very old. Still i will post my solution . Select the youtube video copy it in www.keepvid.com and copy the link of mp4 link in the output and
place it in m4v like i have done below. Hope it helps!!

$(document).ready(function(){
    $("#jquery_jplayer_1").jPlayer({
      ready: function () {
        $(this).jPlayer("setMedia", {
          title: "SunPower ",
          m4v: "http://r5---sn-gxap5ojx-cage.googlevideo.com/videoplayback?id=o-ALJ4-wQ4MYVyJdE719LaJKrErDdpJZueJzUA0RerhRZ6&signature=B38619824A13AB720C1CCF27B9CB806DDF22E1F0.39F677BA557CA5D2D32E6F2EA253542C5A8B6B17&sver=3&mt=1397553860&mv=u&upn=-rcdSogVJaM&mws=yes&sparams=id%2Cip%2Cipbits%2Citag%2Cpcm2fr%2Cratebypass%2Csource%2Cupn%2Cexpire&source=youtube&pcm2fr=yes&itag=22&key=yt5&ip=164.164.88.35&fexp=900064%2C901454%2C937417%2C913434%2C936916%2C934022%2C936923&ms=au&ipbits=0&ratebypass=yes&expire=1397578291&title=Updated%20SunPower%20Monitoring%20System",
          ogv: "http://www.jplayer.org/video/ogv/Big_Buck_Bunny_Trailer.ogv",
          poster: "http://www.jplayer.org/video/poster/Big_Buck_Bunny_Trailer_480x270.png"
        });
      },
      swfPath: "/js",
      supplied: "m4v, ogv"
    });
  });

Key Medium

unread,
Nov 21, 2015, 3:16:09 PM11/21/15
to jPlayer: HTML5 Audio & Video for jQuery
You can use Youtube's iFrame API. I use videojs-youtube, which does this well. I'm sure a similar solution can be made for jPlayer!

Renan Decarlo

unread,
Aug 1, 2016, 12:34:31 PM8/1/16
to jPlayer: HTML5 Audio & Video for jQuery
Reply all
Reply to author
Forward
0 new messages