2

Can I do:

<source th:src="@{{{videoPathsTh[$index]}}}" type="video/mp4"></source>

Like this:

<source scr="{{videoPaths[$index]}}" type="video/mp4"</source>

Or how can I load values from the controller in th:src? Can you provide me another way?

Update

<li ng-repeat="video in videos">Video-ul: {{$index+1}} >
    <video width="300" controls="controls">
        <source ng-src="{{videoPaths[$index]}}"
                th:src="@{{{videoPathsTh[$index]}}}" type="video/mp4">
        </source>
    </video>
</li>

Update:

Apparently Thymeleaf it loads the video successfully if I leave the source like this:

<source th:src="@{{{videoPathsTh[$index]}}}" type="video/mp4"></source>

or

<source src="{{videoPaths[$index]}}" th:src="@{{{videoPathsTh[$index]}}}" type="video/mp4"></source>

But I receive this error:

Failed to load resource: the server responded with a status of 404 () - /%7B%7BvideoPathsTh[$index]%7D%7D

I think it's because the server loads the HTML file before Client loads the page and the AngularJS controller can't send the values.

3
  • Can you please add controller code, So i will help you Commented Jun 16, 2017 at 12:45
  • Videopaths it's just an array of strings Commented Jun 16, 2017 at 12:46
  • I updated my post by adding how I need those values Commented Jun 16, 2017 at 12:51

1 Answer 1

1

I guess it's not possible...Thanks

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.