开发者

video player on a website [closed]

开发者 https://www.devze.com 2023-02-07 04:40 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago. 开发者_开发知识库

i have a website and i would like to have my own video player..how can i make my own video player that can play a youtube links....is anybody has an idea?...

thank you!..


just for make things clear:

1 - video can be embedded in various ways and various formats such as RealMedia, QuickTime, Windows Media and Flash animations.

2 - the most used and reliable is the last one (Flash) that can play FLV, MP4 & SWF files, the most used by service like YouTube.

3 - jQuery and therefore Javascript can be only used to Create and Append the Flash Object for you, deal with swfobject callbacks and parameters (falshvars).


Simple Implementation

DEMO: http://jsbin.com/ilafi4

<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <script src="jquery.min.js"></script> 
        <script src="jquery.swfobject.js"></script> 
        <script src="jquery.jwplayer.js"></script
  <script>
  $(function() {
    $('#player').jwPlayer({
        id: 'jwPlayer',
        swf: 'player.swf',
        file: 'http://www.youtube.com/watch?v=4FROxZ5i67k',
        image: 'my_preview.jpg',
        height: 180,
        width: 240,
        playerready: playerReady
    });
  });
        </script> 
    </head>
    <body>
        <div id="player"></div>
    </body>
</html>

Now, IMHO the powerfull SWF Player i know and use is the JW FLV Player and have also some plugins that support it like this OR this

  • Other Well Know and good Jquery Player is the jQuery media player plugin

Other jQuery Plugin With YouTube support are:

  • http://badsyntax.github.com/jquery-youtube-player/
  • http://www.tikku.com/jquery-youtube-tubeplayer-plugin
  • http://protofunc.com/jme/index.html
  • http://www.viget.com/inspire/youtube-chromeless-video-jquery-plugin/
  • http://www.geckonewmedia.com/blog/2009/8/14/jquery-youtube-playlist-plugin---youtubeplaylist


Making a video player from scratch would have your first choosing a development path (Flash, Silverlight or HTML5) and then going from there. Unless you want to learn there are a lot of quality players that have already been developed and have active communities around them. JW Player is one of these:

http://www.longtailvideo.com/players/jw-flv-player/

Even with the player handled, you still need to encode your video, upload it, and do all sorts of not so fun management of your assets. There's a lot more work to self hosting video than people realize. It can be rewarding and good if there's a specific need for going this route, but often sticking with a service like Youtube or Vimeo is ideal. You get to do the fun part (IE share your video) without any of the development / management burden.

In regards to playing youtube videos, you should just stick to embedding their player on their website. There are many customization options. This article discusses some of these options and how to do it.


If you want to build your own flash player then I'd suggest giving a look at haxe. It's IMO a very nice language (javascript like but with static typing and type inference) that can output .swf files as the result of compilation.

There is also a streaming server written in haxe if you want to serve or capture videos from webcams yourself (I used it long ago and IMO it wasn't ready for production yet, may be now it's better).

The biggest problem I see with Haxe is that's apparently a one-man-band project, and that flash is not going well as popularity (and indeed with HTML5 canvas and video tags it's hard IMO to justify a flash path today).


<object 
  type="application/x-shockwave-flash" 
  data="[INSERT VIDEO URL FROM EMBED CODE PROVIDED HERE]" 
  width="400" 
  height="326">
  <param 
    name="movie" 
    value="[INSERT VIDEO URL FROM EMBED CODE PROVIDED HERE]" />
  <param 
    name="FlashVars" 
    value="playerMode=embedded" />
</object>

As found on Sampletheweb.com through Google.



<iframe class="youtube-player" type="text/html" width="640" height="385" src="http://www.youtube.com/embed/VIDEO_ID" frameborder="0">
</iframe>

OR GO TO: YouTube Article

0

精彩评论

暂无评论...
验证码 换一张
取 消