Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8023631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:37:00+00:00 2026-06-04T22:37:00+00:00

I am trying to embed videos using the Play Framework and JW Player. I

  • 0

I am trying to embed videos using the Play Framework and JW Player. I can hard code and make it work just fine, but I want to use the model’s class to determine the video file (via path) that will be embedded.

Here is the code I have been playing with, but is not working:

<script src="@{'/public/jwplayer/jwplayer.js'}"></script>  

<script>
    $(document).ready(function(){
    var content = ${_post.content};
    setVideo(content)
    });
</script>

<script type='text/javascript'>

    function setVideo( content )
    {
        jwplayer('mediaspace').setup({
            'flashplayer': "@{'/public/jwplayer/player.swf'}",
            'file': content,
            'controlbar': 'bottom',
            'width': '640',
            'height': '480'
        });
    }
</script>

Honestly, this is probably more of pseudo code at this point… But hopefuly it is clear what I am trying to do here:

  1. Retrieve the content of the post (in the case the content will be
    the path to the video)
  2. Place that into the function.
  3. Which will set the ‘file’: content.

Any suggestions on how to tackle this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T22:37:02+00:00Added an answer on June 4, 2026 at 10:37 pm

    Some ideas for tackling the issue:

    1. is the Path visible in the rendered HTML?
    2. is it visible in the generated javascript?
    3. does it need to be escaped correctly? i’d image your var content should be a string?
    4. how does the _post.content get generated? why the underscore? are you doing this from within a play template tag?
    5. is the file accessible via said path, outside of the script?

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make the embed by using AJAX to call the embed code
Following chunk html code works as expected: <iframe src=http://www.amazon.com/></iframe> But when trying embed inner
I am trying to watch videos in my iphone app using the following code:
I'm trying to use the youtube javascript player api to embed youtube videos into
I’m trying to display a page of embed YouTube videos. I got the code
I am trying to embed Facebook video using the code below: <object width=400 height=224
I want to embed vimeo videos in my Vf page. I am trying to
I am trying to embed an opensocial gadget into a email. But I don't
I am trying to embed swf to html, and I'm using SwfObject 2.0 My
I am trying to embed a JFace TableViewer in a SWT TabFolder , but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.