I have the following JavaScript and i need to set the "file" to some string from the c# code.
how can i do that ?
<script type="text/javascript">
jwplayer("myElement").setup({
file: "rtmp://localhost/someFolder/ + VideoFile/,
height: 240,
image: "/assets/myVideo.jpg",
rtmp: {
bufferlength: 0.1
},
width: 280
});
</script>
c#
String VideoFile = "Some video file link"; // example Video01.flv
So, the result will be:
file: "rtmp://localhost/someFolder/Video01.flv/,
Thanks for the helpers.
@Json.Encode(VideoFile)(if you're using Razor)