PageSourceSearch

https://www.vdocipher.com/docs/assets/js/c55a465e.863d86dc.js

js vdocipher.com collected 2026-09-24 17:18:31 UTC 11,442 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkdocusaurus=self.webpackChunkdocusaurus||[]).push([[9241],{11470:(e,t,n)=>{n.d(t,{A:()=>x});var r=n(96540),a=n(34164),s=n(23104),o=n(56347),l=n(205),i=n(57485),u=n(31682),c=n(89466);function d(e){return r.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return e;throw new Error(`Docusaurus error: Bad <Tabs> child <${"string"==typeof e.type?e.type:e.type.name}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.`)})?.filter(Boolean)??[]}function p(e){const{values:t,children:n}=e;return(0,r.useMemo)(()=>{const e=t??function(e){return d(e).map(({props:{value:e,label:t,attributes:n,default:r}})=>({value:e,label:t,attributes:n,default:r}))}(n);return function(e){const t=(0,u.X)(e,(e,t)=>e.value===t.value);if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map(e=>e.value).join(", ")}" found in <Tabs>. Every value needs to be unique.`)}(e),e},[t,n])}function h({value:e,tabValues:t}){return t.some(t=>t.value===e)}function v({queryString:e=!1,groupId:t}){const n=(0,o.W6)(),a=function({queryString:e=!1,groupId:t}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!t)throw new Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:e,groupId:t});return[(0,i.aZ)(a),(0,r.useCallback)(e=>{if(!a)return;const t=new URLSearchParams(n.location.search);t.set(a,e),n.replace({...n.location,search:t.toString()})},[a,n])]}function m(e){const{defaultValue:t,queryString:n=!1,groupId:a}=e,s=p(e),[o,i]=(0,r.useState)(()=>function({defaultValue:e,tabValues:t}){if(0===t.length)throw new Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(e){if(!h({value:e,tabValues:t}))throw new Error(`Docusaurus error: The <Tabs> has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${t.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const n=t.find(e=>e.default)??t[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:s})),[u,d]=v({queryString:n,groupId:a}),[m,b]=function({groupId:e}){const t=function(e){return e?`docusaurus.tab.${e}`:null}(e),[n,a]=(0,c.Dv)(t);return[n,(0,r.useCallback)(e=>{t&&a.set(e)},[t,a])]}({groupId:a}),f=(()=>{const e=u??m;return h({value:e,tabValues:s})?e:null})();(0,l.A)(()=>{f&&i(f)},[f]);return{selectedValue:o,selectValue:(0,r.useCallback)(e=>{if(!h({value:e,tabValues:s}))throw new Error(`Can't select invalid tab value=${e}`);i(e),d(e),b(e)},[d,b,s]),tabValues:s}}var b=n(92303);const f={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var y=n(74848);function T({className:e,block:t,selectedValue:n,selectValue:r,tabValues:o}){const l=[],{blockElementScrollPositionUntilNextRender:i}=(0,s.a_)(),u=e=>{const t=e.currentTarget,a=l.indexOf(t),s=o[a].value;s!==n&&(i(t),r(s))},c=e=>{let t=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{const n=l.indexOf(e.currentTarget)+1;t=l[n]??l[0];break}case"ArrowLeft":{const n=l.indexOf(e.currentTarget)-1;t=l[n]??l[l.length-1];break}}t?.focus()};return(0,y.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.A)("tabs",{"tabs--block":t},e),children:o.map(({value:e,label:t,attributes:r})=>(0,y.jsx)("li",{role:"tab",tabIndex:n===e?0:-1,"aria-selected":n===e,ref:e=>l.push(e),onKeyDown:c,onClick:u,...r,className:(0,a.A)("tabs__item",f.tabItem,r?.className,{"tabs__item--active":n===e}),children:t??e},e))})}function j({lazy:e,children:t,selectedValue:n}){const a=(Array.isArray(t)?t:[t]).filter(Boolean);if(e){const e=a.find(e=>e.props.value===n);return e?(0,r.cloneElement)(e,{className:"margin-top--md"}):null}return(0,y.jsx)("div",{className:"margin-top--md",children:a.map((e,t)=>(0,r.cloneElement)(e,{key:t,hidden:e.props.value!==n}))})}function g(e){const t=m(e);return(0,y.jsxs)("div",{className:(0,a.A)("tabs-container",f.tabList),
1children:[(0,y.jsx)(T,{...t,...e}),(0,y.jsx)(j,{...t,...e})]})}function x(e){const t=(0,b.A)();return(0,y.jsx)(g,{...e,children:d(e.children)},String(t))}},19365:(e,t,n)=>{n.d(t,{A:()=>o});n(96540);var r=n(34164);const a={tabItem:"tabItem_Ymn6"};var s=n(74848);function o({children:e,hidden:t,className:n}){return(0,s.jsx)("div",{role:"tabpanel",className:(0,r.A)(a.tabItem,n),hidden:t,children:e})}},28453:(e,t,n)=>{n.d(t,{R:()=>o,x:()=>l});var r=n(96540);const a={},s=r.createContext(a);function o(e){const t=r.useContext(s);return r.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:o(e.components),r.createElement(s.Provider,{value:t},e.children)}},51510:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>h,frontMatter:()=>l,metadata:()=>u,toc:()=>d});var r=n(74848),a=n(28453),s=n(11470),o=n(19365);const l={id:"ttl",title:"Time-to-live for OTP Validity",sidebar_label:"\u23f0 OTP Time-to-live"},i=void 0,u={id:"server/playbackauth/ttl",title:"Time-to-live for OTP Validity",description:"By default the OTP validity is set to 6 hours. You can create shorter lived URLs by passing ttl parameter. This value is to be set in seconds.",source:"@site/docs/server/playbackauth/ttl.md",sourceDirName:"server/playbackauth",slug:"/server/playbackauth/ttl",permalink:"/docs/server/playbackauth/ttl",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{id:"ttl",title:"Time-to-live for OTP Validity",sidebar_label:"\u23f0 OTP Time-to-live"},sidebar:"server",previous:{title:"\ud83d\udcc3 Overview",permalink:"/docs/server/playbackauth/reqbody"},next:{title:"\ud83e\udeaa Watermark Videos",permalink:"/docs/server/playbackauth/anno"}},c={},d=[{value:"Get OTP Sample Code",id:"get-otp-sample-code",level:2}];function p(e){const t={code:"code",h2:"h2",p:"p",pre:"pre",...(0,a.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(t.p,{children:["By default the OTP validity is set to 6 hours. You can create shorter lived URLs by passing ",(0,r.jsx)(t.code,{children:"ttl"})," parameter. This value is to be set in seconds."]}),"\n",(0,r.jsx)(t.p,{children:"The ttl value is relevant when there is a time-gap between the website backend requesting the OTP, and the video player loading on client-side. Such a scenario is relevant for users watching videos on very slow connections. We recommend a minimum ttl of 5 minutes. It is unrealistic for any user to be waiting for more than 5 minutes for video player load. Please note that a new OTP is generated 
1when a page is refreshed."}),"\n",(0,r.jsx)(t.p,{children:"By setting a very long ttl (30 years) you can create a static video URL, that you may use as part of your home page and for non-premium content."}),"\n",(0,r.jsx)(t.p,{children:"This code below sets the ttl to 5 minutes."}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{children:'{\n  "ttl": 300\n}\n'})}),"\n",(0,r.jsx)(t.h2,{id:"get-otp-sample-code",children:"Get OTP Sample Code"}),"\n",(0,r.jsxs)(t.p,{children:["The sample videoID is ",(0,r.jsx)(t.code,{children:"1234567890"})," and the API Secret Key is ",(0,r.jsx)(t.code,{children:"a1b2c3d4e5"}),". The time-to-live for OTP validity is set to 300s in the sample code."]}),"\n",(0,r.jsx)(t.p,{children:"The sample code only passes the OTP time-to-live as parameter."}),"\n",(0,r.jsxs)(s.A,{defaultValue:"sh",values:[{label:"CURL",value:"sh"},{label:"NODE",value:"js"},{label:"PHP",value:"php"},{label:"C#",value:"cs"},{label:"Python",value:"py"},{label:"Ruby",value:"rb"}],children:[(0,r.jsx)(o.A,{value:"sh",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-sh",children:"curl -X POST \\\n  https://dev.vdocipher.com/api/videos/1234567890/otp \\\n  -H 'Accept: application/json' \\\n  -H 'Authorization: Apisecret a1b2c3d4e5' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n  \"ttl\":300\n}'\n"})})}),(0,r.jsx)(o.A,{value:"js",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-js",children:"var request = require('request');\n\nvar options = {\n  method: 'POST',\n  url: 'https://dev.vdocipher.com/api/videos/1234567890/otp',\n  headers: {\n    'Accept': 'application/json',\n    'Content-Type': 'application/json',\n    'Authorization': 'Apisecret a1b2c3d4e5',\n  },\n  body: {ttl: 300},\n  json: true,\n};\n\nrequest(options, function (error, response, body) {\n  if (error) throw new Error(error);\n\n  console.log(body);\n});\n"})})}),(0,r.jsx)(o.A,{value:"php",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-php",children:'$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n  CURLOPT_URL => "https://dev.vdocipher.com/api/videos/1234567890/otp",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_ENCODING => "",\n  CURLOPT_MAXREDIRS => 10,\n  CURLOPT_TIMEOUT => 30,\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n  CURLOPT_CUSTOMREQUEST => "POST",\n  CURLOPT_POSTFIELDS => json_encode([\n    "ttl" => 300,\n  ]),\n  CURLOPT_HTTPHEADER => array(\n    "Accept: application/json",\n    "Authorization: Apisecret a1b2c3d4e5",\n    "Content-Type: application/json"\n  ),\n));\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n  echo "cURL Error #:" . $err;\n} else {\n  echo $response;\n}\n'})})}),(0,r.jsx)(o.A,{value:"cs",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-cs",children:'var client = new RestClient("https://dev.vdocipher.com/api/videos/1234567890/otp");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader("Accept", "application/json");\nrequest.AddHeader("Content-Type", "application/json");\nrequest.AddHeader("Authorization", "Apisecret a1b2c3d4e5");\nrequest.AddParameter("undefined", "{\\n\\t\\"ttl\\":300\\n}", ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);\n'})})}),(0,r.jsx)(o.A,{value:"py",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-python",children:'import requests\nimport json\n\nurl = "https://dev.vdocipher.com/api/videos/1234567890/otp"\n\npayload = json.dumps({\'ttl\': 300})\nheaders = {\n    \'Authorization\': "Apisecret a1b2c3d4e5",\n    \'Content-Type\': "application/json",\n    \'Accept\': "application/json"\n    }\n\nresponse = requests.request("POST", url, data=payload, headers=headers)\n\nprint(response.text)\n'})})}),(0,r.jsx)(o.A,{value:"rb",children:(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ruby",children:"require 'uri'\nrequire 'json'\nrequire 'net/http'\n\nurl = URI(\"https://dev.vdocipher.com/api/videos/1234567890/otp\")\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"Authorization\"] = 'Apisecret a1b2c3d4e5'\nrequest[\"Content-Type\"] = 'application/json'\nrequest[\"Accept\"] = 'application/json'\nrequest.body = ({:ttl => 300}).to_json\n\nresponse = http.request(request)\nputs response.read_body\n"})})})]})]})}function h(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(p,{...e})}):p(e)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.