# Video playback fails if repeat filename is used

**URL:** <https://community.thunkable.com/t/video-playback-fails-if-repeat-filename-is-used/1664815>\
**Category:** Questions about Thunkable X\
**Tags:** video\
**Created:** [January 3, 2022, 8:33pm UTC](https://community.thunkable.com/t/video-playback-fails-if-repeat-filename-is-used/1664815 "2022-01-03T20:33:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 3, 2022, 8:33pm UTC](https://community.thunkable.com/t/video-playback-fails-if-repeat-filename-is-used/1664815/1 "2022-01-03T20:33:11Z")

</div>

**Edit #2: I think this is all being caused by the same video filename being chosen two (or more) times in a row. Any time that happens, it doesn’t play the video until a _different_ filename is chosen. Any ideas for how to fix that?**

**Updated project link:** [Thunkable](https://x.thunkable.com/copy/4ed166d8110243aee9c183529f6d866f)

**Also mentioned here:** [Can't play video with same filename twice in a row · Issue #1094 · thunkable/thunkable-issues · GitHub](https://github.com/thunkable/thunkable-issues/issues/1094)

I have a project with a button that plays one of four videos at random. The videos are each approximately one second long. I’d like to have it so that when you click the button, it always plays a video. But currently, it doesn’t quite do that. Instead, sometimes it just does nothing when I click the button. This happens in a browser Preview and in Thunkable Live on an iPhone 11.

I’ve tried different wait block values (1 second, 1.5, 3) and none of them seem to make much difference. I’ve also tried it without a wait block. Again, it works most of the time but not always. It’s inconsistent.

Here’s a video showing the problem (I tap the Roll button four times but it only plays two videos):

![RPReplay_Final1641241530_MP4_AdobeCreativeCloudExpress](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/2/629290429c89294d968ab88ea8b8dd4da74b0d79.gif)

Here’s the code:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/6/561df013efdef3f2a0de487da5130b4005c23e6a.png)

I’m setting the Video value to an empty string ("") because without that it won’t play a video at all if the filename matches the current setting (e.g. if Video is set to “roll2.mov” and it randomly picks “roll2.mov” again). Or so I thought! That doesn’t appear to actually do anything in further testing.

**Edit:** I also tried adding a wait block between the `set Video1's Video` and `set Video1's Play` blocks but that doesn’t seem to help much.

And the project:

[https://x.thunkable.com/copy/5a8b9afd8b03de366498c647964f3730](https://x.thunkable.com/copy/5a8b9afd8b03de366498c647964f3730)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 3, 2022, 9:42pm UTC](https://community.thunkable.com/t/video-playback-fails-if-repeat-filename-is-used/1664815/3 "2022-01-03T21:42:19Z")

</div>

Okay, I got it to work by adding a wait block (even 0 seconds fixes it):

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/7/c7f1ab00b1c40768799f4cab91898379d2765128.png)

It would be nice not to have to use a workaround, though.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [April 3, 2022, 9:43pm UTC](https://community.thunkable.com/t/video-playback-fails-if-repeat-filename-is-used/1664815/4 "2022-04-03T21:43:02Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
