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.

user3736334
  • 311
  • 1
  • 3
  • 15

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://vuejs.org/v2/guide/syntax.html#Attributes

How to bind to attribute in Vue JS?

Kamlesh Paul
  • 10,404
  • 2
  • 18
  • 30