0

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 <object> tag).

Below I'll list both the outputs:

  • Default Page (Correct Output)

<div class="field-items">

  <div class="field-item even">

    <div class="jwplayer-video"> 

      <div id="a7638d2f8c40bfe2669593f3ee69e066_wrapper" style="position: relative; width: 200px; height: 200px;">

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

        </object>

      </div> 

    </div> 

  </div> 

</div>

  • Custom Template Output of a Video (Wrong)

<div class="field-items">

  <div class="field-item even">

    <span class="file">

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

      <a href="/page24_3.mp4" type="video/mp4; length=4838313">page24.mp4</a>

    </span>

  </div>

</div>

  • 1
    You checked the display settings of your new content type, did you? – leymannx Sep 7 '15 at 20:10
0

There are many ways you can do this

  1. Jwplayer Drupal Module

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

  1. Embedding jwplayer in HTML5

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

For your example :

WRONG CODE (dont use)

<div class="field-item even">

<span class="file">

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

<a href="/page24_3.mp4" type="video/mp4; length=4838313">page24.mp4</a>

</span></div></div>

Try This

<div class="field-items">

    <div class="field-item even">
        <span class="file">

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

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

        </span>
    </div>
</div>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.