Why is JW Player not working in custom Content Type? I am having a weird problem.

I downloaded JW Player and used it on my page (Default Page Content Type) to show video. It worked seamlessly. Now there was one requirement that there would be a page with different fields. I hence created a custom Content Type with different fields (including video of-course).

Now I am attaching a VIDEO normally in both the fields, but one page with the custom content type weirdly doesn't show the video. What it shows it blunt listing of the Video Link.

How can I make JW player in my custom content type page (making it show &lt;object&gt; tag).

Below I'll list both the outputs:


Default Page (Correct Output)




&lt;div class="field-items"&gt;

  &lt;div class="field-item even"&gt;

    &lt;div class="jwplayer-video"&gt; 

      &lt;div id="a7638d2f8c40bfe2669593f3ee69e066_wrapper" style="position: relative; width: 200px; height: 200px;"&gt;

        &lt;object type="application/x-shockwave-flash" data="http://player.swf" width="100%" height="100%" bgcolor="#ffffff" id="a76593f3ee69e066" name="a76593f3ee69e066" tabindex="0"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;param name="seamlesstabbing" value="true"&gt;&lt;param name="wmode" value="opaque"&gt;&lt;param name="flashvars" value="netstreambasepath=page24_2.mp4&amp;amp;skin=glow.xml&amp;amp;autostart=1&amp;amp;controlbar.position=none"&gt;

        &lt;/object&gt;

      &lt;/div&gt; 

    &lt;/div&gt; 

  &lt;/div&gt; 

&lt;/div&gt;





Custom Template Output of a Video (Wrong)




&lt;div class="field-items"&gt;

  &lt;div class="field-item even"&gt;

    &lt;span class="file"&gt;

      &lt;img class="file-icon" alt="" title="video/mp4" src="/0065bd-doc/ops-lop/modules/file/icons/video-x-generic.png"&gt; 

      &lt;a href="/page24_3.mp4" type="video/mp4; length=4838313"&gt;page24.mp4&lt;/a&gt;

    &lt;/span&gt;

  &lt;/div&gt;

&lt;/div&gt;
There are many ways you can do this 


Jwplayer Drupal Module


Video : http://www.youtube.com/watch?v=mAAIfi0pYHw


Embedding jwplayer in HTML5


http://www.longtailvideo.com/support/jw-player/28839/embedding-the-player/

For your example :

WRONG CODE (dont use)
    

&lt;div class="field-item even"&gt;

&lt;span class="file"&gt;

&lt;img class="file-icon" alt="" title="video/mp4" src="/0065bd-doc/ops-lop/modules/file/icons/video-x-generic.png"&gt; 

&lt;a href="/page24_3.mp4" type="video/mp4; length=4838313"&gt;page24.mp4&lt;/a&gt;

&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;


Try This 

&lt;div class="field-items"&gt;

    &lt;div class="field-item even"&gt;
        &lt;span class="file"&gt;

            &lt;img class="file-icon" alt="" title="video/mp4" src="/0065bd-doc/ops-lop/modules/file/icons/video-x-generic.png"&gt; 

            &lt;div id='playerNrEyADwjFyrz' onclick='jwVideoSetup('/page24_3.mp4')'&gt;&lt;/div&gt;
            &lt;script type='text/javascript'&gt;
                function jwVideoSetup(src)
                {
                    jwplayer('playerNrEyADwjFyrz').setup({
                       file: src,
                       title: 'video title',
                       width: '100%',
                       aspectratio: '16:9'
                    });
                }
            &lt;/script&gt;

        &lt;/span&gt;
    &lt;/div&gt;
&lt;/div&gt;