Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: .NET2.0 C#2.0 C# ASP.NET Video , +
Hi friends,
 
I download the jw player. i want to know how to give the video url at the run time for the java script given by jw player. if anyone know the solution help me.
 
Here is the code
 
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
 
 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head  runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1"  runat="server">
 
    <div>  
 
      <div id="mediaplayer">JW Player goes here</div>
 
      <script type="text/javascript" src="jwplayer.js"></script>
 
      <script type="text/javascript">
 
            jwplayer("mediaplayer").setup({
 
                  flashplayer: "player.swf",
 
                  file: "sample.flv",
 
                  image: "preview.jpg"
 
            });
 
    </script>
</div>
    </form>
</body>
</html> 
 
Here the "sample.flv" is the video url i want to give the url at the runtime.
 
thanks,
Posted 4-May-11 4:15am
Edited 4-May-11 4:58am
v3
Comments
Monjurul Habib at 4-May-11 9:59am
   
edited:code block.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Try the following:
 
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
 

 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head  runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1"  runat="server">
 
    <div>
 
      <div id="mediaplayer">JW Player goes here</div>
 
      <script type="text/javascript" src="jwplayer.js"></script>
 
      <script type="text/javascript">
 
         function playSelected(fileURL)
         {
            jwplayer("mediaplayer").setup({
 
                  flashplayer: "player.swf",
 
                  file: fileURL,
 
                  image: "preview.jpg"
 
            });
         }
    </script>
</div>
    </form>
</body>
</html>
 
Now call the function at the time you want to play a file. Just pass the url to the function and it will do the trick.
 
Hope this will help you out.
  Permalink  
Comments
sathya.spidy at 11-May-11 7:03am
   
thanks for your answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 10 May 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100