
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