Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

JW Player in ASP.NET 2.0


Hello guys
Ive used kLinks sample [url=http://www.jeroenwijering.com/?thread=14074]kLink's Sample[/url] to combine a SWF file inside the JW player. In a simple HTML document it works very well without any problem. I insert the code in an ASP.NET 2.0 local website which is located on my computer. The JW Player *DOES* appear but when I click on the play button the loading indicator appears and never main video being played. I suppose that a few settings should be applied to IIS. I am using IIS7 in Windows Vista and I would be really appreciated if anyone can help me here.

14 Community Answers

JW Player

User  
-1 rated :

As always, post your code or a link to your test page.

JW Player

User  
1 rated :

well i put the javascript and css code in a master page file:
bc.. <%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %>

<!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></title>
<link href="Style.css" rel="stylesheet" type="text/css" />
<!--
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>-->

<!--player-->
<style type="text/css">
div.playercontainer
{
position: absolute;
top: 200px;
left: 400px;
width: 427px;
height: 260px;
z-index: 0;
}

div.swfcontainer
{
position: absolute;
top: 352px;
left: 437px;
width: 80px;
height: 80px;
/* border: solid 1px #808080; */
z-index: 1;
}
</style>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js"></script>
<!--<script type="text/javascript" src="mediaplayer/swfobject.js"></script>-->

<script type="text/javascript">
</script>

<script type="text/javascript">
var flashvars =
{
'streamer': 'lighttpd',
'file': 'mediaplayer/video.flv',
'title': 'Main Video',
'description': 'This is the main video.',
'skin': 'mediaplayer/player.swf',
'repeat': 'always',
'stretching': 'exactfit',
'icons': 'false',
'frontcolor': '86C29D', // text & icons (green)
'backcolor': '849BC1', // playlist background (blue)
'lightcolor': 'C286BA', // selected text/track highlight (red)
'screencolor': '000000', // screen background (black)
'autostart': 'false'
};

var params =
{
'allowfullscreen': 'true',
'allowscriptaccess': 'always',
'wmode': 'opaque',
'bgcolor': '#FFFFFF'
};

var attributes =
{
'name': 'playerId',
'id': 'playerId'
};

swfobject.embedSWF('mediaplayer/player.swf', 'player', '427', '280', '9.0.124', false, flashvars, params, attributes);
</script>

<script type="text/javascript">
var flashvars =
{
};

var params =
{
allowfullscreen: 'false',
allowscriptaccess: 'always',
wmode: 'transparent'
};

var attributes =
{
name: 'swfId',
id: 'swfId'
};

swfobject.embedSWF('mediaplayer/links.swf', 'swf', '380', '180', '9.0.124', false, flashvars, params, attributes);
</script>
</head>

<body>
<form id="form1" runat="server">
<div>
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">

</asp:ContentPlaceHolder>
</div>
</form>
</body>




and here is the relevant section of the page that is using the master page and the player is dwelling inside it:
bc.. <div id="page_content">

<!--start of middle column-->
<!--player-->
<div id="playercontainer" class="playercontainer">
<a id="player" class="player" href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Adobe Flash Player to see this video.</a>
</div>
<div id="swfcontainer" class="swfcontainer">
<a id="swf" class="swf" href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Adobe Flash Player to see this video.</a>
</div>
<!--end of middle column-->
</div>

JW Player

User  
0 rated :

when using exotic nonstandard proprietary systems and languages - start with a standard .html test page, with just a player
and then only when you have seen that work first - start the experiments with the transferral...

JW Player

User  
0 rated :

I'm not sure what you mean by a local website. The player page must be online for online file access. That means at least http://localhost/path/playerpage.html

Also, Flash content doesn't work well in forms. However, there are workarounds for .NET and/or ASP which must be placed in forms. I'm not very familiar with them, so use Google "Flash Content ASP Forms" and you will probably find the workarounds.

JW Player

User  
0 rated :

@kLink:
I think that the problem is not what you mentioned. Even i tested the swfobject.net and that problem still exist. Just for testing purpose, I move the folder that contains all JW Player's files which works perfect outside an ASP.NET project but when i move that folder inside my ASP.NET it stops working( the html sample that you gave me doesn't work in an ASP.NET website). So i think the problem is something related to IIS or other factors and definitly it's not related to ASP.NET form element or such things.

JW Player

User  
0 rated :

i uploaded a picture that shows how JW Player appears in my ASP.NET website:
bc.. http://i36.tinypic.com/a3e06a.jpg


the loading indicator never stops loading!

JW Player

User  
0 rated :

@JAAB - from - *http://www.jeroenwijering.com/?item=JW_FLV_Media_Player* bc.. Also note that javascript interaction doesn't work for SWF files inside a <form> tag.
while it is true that the js-api doesnt work out of the box inside form tags, there are several postings in the forum telling thet it can be made to work - but the form tag, and the whole asp.net stuff upsets the namespace hierachy, and makes it a genuine pain to restore to a working condition !

try some forum wide searches - *http://www.jeroenwijering.com/?search=asp*

and then you will have to go about it an extremely systematic way - in the code you posted there are way too many unknown factors that can be the cause of the problem(s) - small steps are what is needed.

youve seen it work on a plain .html page you say - so we know the player can work on your server - leaving out the asp stuff

so you are in for a really painstaking series of meticulous experiments, starting with the working .html page - change only one thing at the time and test - so that you have a fair chance to notice when what breaks what. - then repair and repeat procedure

edit: it hits me, that you should also try use full paths everywhere ! maybe that asp.net directory is virtual and ruins the paths

JW Player

User  
1 rated :

bc.. it hits me, that you should also try use full paths everywhere ! maybe that asp.net directory is virtual and ruins the paths


I suppose you are right. I copied my whole website to another location and ran my website without IIS7(with ASP.NET built-in web server) and the plain .html sample started to work but the .aspx page still have that problem. Do you guys have any idea how can i solve the problem?

JW Player

User  
0 rated :

Finally i managed to run the JW Player in ASP.NET websites. The solution is really ridiculous and i am not going to write it here since it's not really a true solution. But i still can't run JW Player under IIS7 while my website must run under IIS7. any idea?

JW Player

User  
0 rated :

I did everything as mentioned in the tutorial
http://www.beansoftware.com/Free-ASP.NET-Controls/JW-FLV-Control.aspx
to make this control works on asp.net 2 page but still not working, and The message appears is get the flash player to see this player.
steps I did as follows:
1.adding JW-FLV-Player-Control.dll as reference in visual studio
2.set properties :
- File : URL to .flv video file
- FlashPlayerLocation : URL to player.swf file
- Swfobject_jsLocation : URL to swfobject.js javascriptfile
3. i got the latest flash player installed on my pc
but still not working


there is javascript error : swfobject is undefined
Please help me to solve this problem

JW Player

User  
0 rated :

test

JW Player

User  
0 rated :

Try this site: *http://www.arjones.net/opensource/swfobject.net/* (Recommended by the developers of swfobject.)

JW Player

User  
0 rated :

i tried to implement as per above metirial. but i am not geeting jw player in my website
plz hlep me for this one

Ethan Feldman

JW Player Support Agent  
0 rated :

Can you provide a link to where you are running this?

This question has received the maximum number of answers.