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

JWplayer and spring MVC


Hi,

I'm using JWplayer for educational reasons, my case is that I'm trying to secure the video stream using spring mvc this is how.

JWPlayer client code :


<div style="width: 100%;display: inline-block;">

<div style="float:left;width:300px;height:240px;">
<div id="myElement">Loading the player ...</div>
<script type="text/javascript">
jwplayer("myElement").setup({
file: "http://localhost:8085/ticktock/products",
height: 200,
width: 300
});
</script>
</div>

so the file url is not real path, it takes you to spring application where I have the controller so I can authenticate the user.

this is the controller code

@RequestMapping("/products")
public String getProducts(Model model)
{

// Here I can authenticate the user using my logic

return "redirect:http://localhost/hls/bbb.mp4";
}

so, after finishing the security process it will return the url which it has the video.

this logic won't work with the jwplayer but it works when I test it via entering the url path in the browser, I have no idea why I hope u can help me on that.

Thanks

1 Community Answers

Donni

JW Player Support Agent  
0 rated :

Can you add type: "mp4", and let me know if it starts working for you?

-Donni

This question has received the maximum number of answers.