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

.load not work, hls stream url with url base token


Hello,

I am jwplayer 6, and i have switched on jwplayer 7 newly, i setup my code with normal hls stream url, its working fine, but i have implement some security on my stream, after that .load function is work for stream url, because my stream url has some parameter like:-"http://multitvsolution-lh.akamaihd-staging.net/i/TVTDY01_1@382776/master.m3u8?hdnts=exp=1455193073~acl=/i/TVTDY01_1@382776/*~hmac=654857f337efeb281ead97a4acee247eb4b77b99697fa61af29757675038f976"

first time,
ob = jwplayer('player');
ob.setup({
file: streamfile+'?hdnts='+ token,
primary: 'html5',
autostart: true,
androidhls: true,
type: "hls",
flashplayer: "http://ssl.p.jwpcdn.com/player/v/7.2.4/jwplayer.flash.swf",
width: "50%",
bufferlength: 0.0,
aspectratio: "16:9",
fallback: false,
advertising: {
client: "vast", tag: precampaign,
admessage: "We are currently running commercial break."
}
});

my player is loaded fine and playing, but after advertising, i will switch again to main program using .load function

ob.load([{file: streamfile+'?hdnts='+ token }]);
This is not working, no error on console, i think .load not work,

4 Community Answers

vikash

User  
0 rated :

ob.load([{file: streamfile+'?hdnts='+ token }]);
This is not working, no error on console, i think .load not work,
i have check with
ob.onError(function (e) {
console.log(e);
});
error see on console
Object { message="Error loading playlist: No playable sources found", type="error"}

James Herrieven

User  
0 rated :

Because the type of media file you are playing is not immediately obvious from the URL, you need to tell JW Player what media type it is. You do this in the initial setup with type:"hls", but you are not doing it in the subsequent .load() call.

Try modifying your load code as follows:

ob.load([{file: streamfile+'?hdnts='+ token, "type":"hls" }]);

James Herrieven
===================================================
Powered by Haiku
http://powered-by-haiku.co.uk/
---------------------------------------------------
Tatami for Online Video
http://dev.powered-by-haiku.co.uk/solutions/tatami/
---------------------------------------------------
skype: JamesHerrieven
email: james[at]haiku[dot]co[dot]uk
===================================================

vikash

User  
0 rated :

Hello Herrieven,

I have tried your solution, but still same issue,

James Herrieven

User  
0 rated :

Ok, try constructing the new item object longhand:

var newItem={};
newItem["file"] = streamfile+'?hdnts='+ token;
newItem["type"] = "hls";
var newPL = [];
newPL.push(newItem);
ob.load(newPL);

Also, just check that the variable "streamfile" is what you think it is at this point.

James

This question has received the maximum number of answers.