I am trying to get an instance of a video player (JWPlayer) to cooperate with a template I am using. I am very new to this so please forgive me if this solution is obvious to some.
Objective:
When a user clicks a kendo button on the default.aspx page, a kendo window pops up and is formatted based on a template I pass in. I'd like to display the video inside that kendoWindow inside of a div.
This javascript method is located inside my default.aspx:
This is the template that I have sitting inside of default.aspx:
Problem:
When I open the kendoWindow, it complains that it cannot locate "details-container". I assume this is because it is out of scope for the window, since the javascript method is executing from default.aspx, it doesn't know that "details-container" exists.
Question:
So what is the proper way to implement this? Should I run jwplayer.setup() in the template? What would this look like? Some example code would really help to get me started.
Thanks,
Ray
Objective:
When a user clicks a kendo button on the default.aspx page, a kendo window pops up and is formatted based on a template I pass in. I'd like to display the video inside that kendoWindow inside of a div.
This javascript method is located inside my default.aspx:
function
playVideoNow()
{
jwplayer(
"details-container"
).setup({
file:
"https://www.contoso.com/example.m4v"
,
image:
"https://www.contoso.com/example.png"
});
<script type=
"text/x-kendo-template"
id=
"template"
>
<div id=
"details-container"
>
<h2>Video Name</h2>
<em>Video Date</em>
<dl>
<dt>Some Info: </dt>
<dt>Some More Info:</dt>
</dl>
</div>
# window.onload = playVideoNow() #
</script>
When I open the kendoWindow, it complains that it cannot locate "details-container". I assume this is because it is out of scope for the window, since the javascript method is executing from default.aspx, it doesn't know that "details-container" exists.
Question:
So what is the proper way to implement this? Should I run jwplayer.setup() in the template? What would this look like? Some example code would really help to get me started.
Thanks,
Ray