0

I have a problem displaying a video in view using Laravel as backend and Vue Js as front end. This is my code. I am able to display the filename from the database using {{product.video[0].filename}} but unable to translate this in this line src="'video2/...

This is the code

 {{product.video[0].filename}} //Here am able to display filename correctly from database

<video width="320" height="240" controls>
  <source src="'video2/'+product.video[0].filename type="video/mp4">// This cant capture the 
                                                                           video from video folder.
</video>

But if I write <source src="test.mp4" type="video/mp4"> this works correctly but I want to capture using the exact name from the database.

Hotdot Cyber
  • 361
  • 1
  • 5
  • 21

1 Answers1

1

you need to bind the video src like this :src

<video width="320" height="240" controls>
    <source :src="'video2/'+product.video[0].filename" type="video/mp4">
    video from video folder.
</video>

ref links

https://v2.vuejs.org/v2/guide/syntax.html#Attributes

How to bind to attribute in Vue JS?

tony19
  • 125,647
  • 18
  • 229
  • 307
Kamlesh Paul
  • 11,778
  • 2
  • 20
  • 33