HI,
I try to create a web plex client. I searched on the forum and i don’t find the answer to my problem.
So, can someone explain me how generate a url transcoding?
I try to execute this
<br />
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><br />
<head><br />
<title>Plex Video Player</title><br />
<style type="text/css"><br />
body{<br />
margin:0;<br />
padding:0;<br />
background-color: #000000;<br />
}<br />
</style><br />
</head><br />
<body><br />
<br />
<script type="text/javascript" src="base64.js"></script><br />
<script type="text/javascript" src="jssha256.js"></script><br />
<br />
<script type="text/javascript"><br />
<br />
publicKey = "KQMIY6GATPC63AIMC4R2";<br />
privateKey = decode64("k3U6GLkZOoNIoSgjDshPErvqMIFdE0xMTx8kgsrhnC0=");<br />
<br />
//from Plex Media Server<br />
part = encodeURIComponent('/library/parts/12083/file.avi');<br />
<br />
add= "http://192.168.2.12:32400";<br />
<br />
myurl = "/video/:/transcode/generic.flv?format=flv&videoCodec=flv&videoBitrate=1000&audioCodec=libmp3lame&audioBitrate=128&size=624x336"<br />
myurl = myurl + "&fakeContentLength=2000000000&url=http%3A%2F%2F192.168.2.12%3A32400" + part + "&3g=0&httpCookies=&userAgent=";<br />
<br />
time = Math.round(new Date().getTime() / 1000);<br />
<br />
msg = myurl+"@"+time;<br />
<br />
redirectURL = encodeURIComponent(msg);<br />
<br />
HMAC_SHA256_init(privateKey);<br />
HMAC_SHA256_write(msg);<br />
mac = HMAC_SHA256_finalize();<br />
msg = encode64(array_to_string(mac));<br />
<br />
URL=add+redirectURL+encodeURIComponent("&X-Plex-Access-Key="+publicKey+"&X-Plex-Access-Code="+array_to_string(mac))+encodeURIComponent("&X-Plex-Access-Time="+time);<br />
<br />
document.write("<table cellpadding='0' cellspacing='0' height='100%' width='100%' style='text-align:center;'><tr><td>");<br />
document.write("<embed src='http://192.168.2.12/videoplayer.swf?streamUrl="); //from http://mycast.orb.com/orb/resources/common/videoplayer.swf<br />
document.write(URL);<br />
document.write(" quality='best' scale='noborder' width='100%' height='100%' name='videoplayer' align='middle' allowScriptAccess='sameDomain' ");<br />
document.write(" type='application/x-shockwave-flash' flashvars='file=");<br />
document.write(URL);<br />
document.write("' allowFullScreen='true' pluginspage='https://www.macromedia.com/go/getflashplayer' /></object></td></tr></table>");<br />
<br />
<br />
</script><br />
<br />
</body><br />
</html><br />
But i got a 330 (net::ERR_CONTENT_DECODING_FAILED) error.
Thank u