7

I am pretty new with Razor Mediator and of course having some issues while testing my TBBs. I am writing a TBB that renders HTML for HTML5 videos like this.

<h2>@Fields.title</h2>
<Video id="@Component.ID" height="@Metadata.height" width="@Metadata.width" poster="@Fields.poster" controls="@Metadata.controls" preload="@Metadata.preload">
    @foreach (var source in Fields.sources) {
        var mimetype = @source.TridionObject.BinaryContent.MultimediaType.MimeType;
        <source type="@mimetype" src="@source" />
    }
</Video>

This code generates the following output.

<h2>Video Player Fitted For Sidebar Page</h2>
<Video id="tcm:5-172" height="287" width="510" poster="tcm:5-50" controls="controls" preload="auto">
        <source type="video/mp4" src="tcm:5-51" tridion:href="tcm:5-51" tridion:type="Multimedia" tridion:targetattribute="src" />
        <source type="video/webm" src="tcm:5-53" tridion:href="tcm:5-53" tridion:type="Multimedia" tridion:targetattribute="src" />
        <source type="video/ogg" src="tcm:5-52" tridion:href="tcm:5-52" tridion:type="Multimedia" tridion:targetattribute="src" />
        <source type="application/x-shockwave-flash" src="tcm:5-145" tridion:href="tcm:5-145" tridion:type="Multimedia" tridion:targetattribute="src" />
</Video>

The output seems to be all good. but when I try to use the standard LinkResolver TBB, this is the output I get.

<h2>Video Player Fitted For Sidebar Page</h2>
<Video id="tcm:5-172" height="287" width="510" poster="tcm:5-50" controls="controls" preload="auto">
        <source src="tcm:0-0-0"  type="video/mp4" />
        <source src="tcm:0-0-0"  type="video/webm" />
        <source src="tcm:0-0-0"  type="video/ogg" />
        <source src="tcm:0-0-0"  type="application/x-shockwave-flash" />
</Video>

Any advice?, Should I create my own Link Resolver?

Thank you. Eric.

4

This blog post suggests that - in order for the Link Resolver to work successfully for tridion:type="Multimedia" - you have to manually publish the binaries prior to resolving the link.

What happens if you use the "Publish Binaries in Package" TBB before Resolve Links (or, even, use Default Finish Actions)?

What I'm not sure of is whether these multimedia items will be automatically added to the package by the Razor Mediator as they would be with DWT - perhaps failing the above you could try manually adding the items to the package?

| improve this answer | |
  • Yes, I had to add a TBB to publish the Image, I thought that enabling the extractBinaries property will publish the images too but it seems to just add the to the package. – Eric Huiza Mar 27 '13 at 23:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.