Peter
Peter

Reputation: 803

Kentico video not rendering

I'm trying to render a video using a custom transformation. I have the following transformation

        <video width="320" height="240" controls>
          <source src="<%# GetFileUrl('VideoFile') %>" type='video/mp4' >
        </video>

But this will display :"Too many characters in character literal". Any idea this is happening?

Upvotes: 1

Views: 305

Answers (2)

Chetan Sharma
Chetan Sharma

Reputation: 1442

Here are few things that you can try:-

  1. If you are uploading a video to a page type then you can directly access that URL using it's field name

    <video width="320" height="240" controls> <source src="<%# Eval("VideoFile") %> type='video/mp4'> </video>

  2. Check your IIS settings if you server is able to serve files with MIME type video/mp4 and are not getting 404 error in browser developer's console. In your web.config file under <staticContent> tag check if you have this entry.

    <mimeMap fileExtension=".mp4" mimeType="video/mp4" />

Upvotes: 0

hutchonoid
hutchonoid

Reputation: 33305

You need to change it to the following:

    <video width="320" height="240" controls>
      <source src='<%# GetFileUrl("VideoFile") %>' type='video/mp4' >
    </video>

The GetFileUrl is taking the argument as a single character, also note the single quotes around the source attribute too.

Upvotes: 3

Related Questions