Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

html5 video tag #11

Open
omgbox opened this issue Nov 23, 2020 · 1 comment
Open

html5 video tag #11

omgbox opened this issue Nov 23, 2020 · 1 comment

Comments

@omgbox
Copy link

omgbox commented Nov 23, 2020

hi, i'm trying to directly embed the url magnet format without going into list mode and copying the link , how could i automatically output the filename to video tag.

something like this

> <video width="320" height="240" controls>
>   <source src="http://localhost/list/html/mp4/-/magnet/etc " type="video/mp4">
> Your browser does not support the video tag.
> </video>
> 

instead of using the generated output linke example
http://localhost/content/08ada5a7a6183aae1e09d831df6748d566095a10/Sintel/Sintel.mp4

@WinPooh32
Copy link
Owner

WinPooh32 commented Nov 24, 2020

Use json list instead of html and extract all data you need by JavaScript.

Example json output for http://localhost/list/json/mp4/-/hash/08ada5a7a6183aae1e09d831df6748d566095a10:

{
  "header": {
    "hash": "08ada5a7a6183aae1e09d831df6748d566095a10",
    "name": "Sintel",
    "files": 11
  },
  "content": [
    {
      "name": "Sintel",
      "name_orig": "Sintel.mp4",
      "ext": ".mp4",
      "mime": "video/mp4",
      "size": 129241752,
      "path": [
        "Sintel.mp4"
      ],
      "tags": []
    }
  ]
}

You can build url to file:

let obj = JSON.parse(<your_json_string>)
let filepath = `${obj.header.name}/${obj.content[0].path[0]}` 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants