Code Monkey home page Code Monkey logo

Comments (7)

tomap avatar tomap commented on June 9, 2024 2

Hi,
I tested the suggestion of @yoshinorin and it works fine:
https://github.com/tomap/hexo-theme-minidyne-demo/pull/4/files
I added the size and controls otherwise you cannot play it
It works fine:
https://deploy-preview-4--hexo-theme-minidyne-demo.netlify.com/2010/07/07/old-post-7/

If you still cannot use the video, In suggest you open an issue in the right place:
https://github.com/hexojs/hexo/issues
Your issue has nothing to do with markdown rendering

And I suspect your issue is that you are trying to display amazon prime videos, which ight not be allowed by their platform :)

I'm closing the issue.

Regards

from hexo-renderer-marked.

yoshinorin avatar yoshinorin commented on June 9, 2024

How about this ?

hexo.extend.tag.register('video', function(args){
    return `<video> <source src="${args[0]}" type="video/mp4"> </video>`;
  });
}, {async: true});

Usaga.

{% video test.mp4 %}

I think, maybe below plugin's source code may help you.

from hexo-renderer-marked.

yoshinorin avatar yoshinorin commented on June 9, 2024

P.S
I have not try above code. So, it may have something wrong.

from hexo-renderer-marked.

tomap avatar tomap commented on June 9, 2024

https://hexo.io/docs/tag-plugins#YouTube

There is already a vimeo and YouTube tag helper. It should be fairly easy to either add a video tag helper or to use those as inspiration for what you want to do

from hexo-renderer-marked.

gurupras avatar gurupras commented on June 9, 2024

I did use those and others as inspirations on how to implement this. Upon further investigation, the problem seems to be with the <video> tag. The moment I add two to the page, markdown parsing gets broken.

Here's the output from having just one <video> on the page:

image

Here's what happens once I add two <video> elements:

image

The developer console tells me that the entire markdown for the second paragraph (The one with '#') was treated as a string and not parsed for markdown.

image

from hexo-renderer-marked.

enkr1 avatar enkr1 commented on June 9, 2024

Hi {% video %} seems to work but is there any attributes that we can use? e.g. width, autoplay, etc.

from hexo-renderer-marked.

tomap avatar tomap commented on June 9, 2024

More info on this repo: https://github.com/hexojs/hexo-tag-embed?tab=readme-ov-file#youtube

from hexo-renderer-marked.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.