Dynamic video on Order Status page - Is this scripting correct?

Our aim is to have a variety of videos load on our order status page based on a few cart items; ultimately so we can offer different deals discounts and special messaging. I put together this coding below and wanted to check if this should be applicable.
The idea being if they have item A then this video+discountA loads, if they have item B, then this video+discountB loads, for all other customers this video+discountX loads:

{% if first_time_accessed %}

{% endif %}