Embedding a Media Player

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
I have been trying to embed a media player like this for some time now, and I need to know which file to place the code in for step #2. I want this on the products page, and step #2 needs to be in the (head) HTML section of the page. Step #3 can be placed on the products page with the product description using the editor.



Embedding the JW Player on your website is a simple, 3-step process:
1. Upload the jwplayer.js and player.swf files from the download ZIP to your server. All other files in the download (documentation, source code, etc) are optional.

2. Include the jwplayer.js somewhere in the head of your webpage:
<script type="text/javascript" src="/jwplayer/jwplayer.js"></script>

3. Call the player setup somewhere in the body of your website. Here's a basic example:
<div id="container">Loading the player ...</div> <script type="text/javascript"> jwplayer("container").setup({ flashplayer: "/jwplayer/player.swf", file: "/uploads/video.mp4", height: 270, width: 480 }); </script>

Thanks, for any help on this...
J Parker
12 years ago
For step 2, add to the productinfo page in code behind - \NopCommerceStore\Modules\ProductInfo.ascx.cs

add the following lines to the OnPreRender method:

string jwPlayer = CommonHelper.GetStoreLocation() + "/jwplayer/jwplayer.js";
Page.ClientScript.RegisterClientScriptInclude(jwPlayer, jwPlayer);

rebuild and upload NopCommerceStore.dll in the bin subfolder and upload productinfo.ascx.cs to the modules subfolder.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.