Guest User

Untitled

a guest
Oct 29th, 2018
155
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     Component {
  2.       id: videoPreviewWrapper
  3.       Video {
  4.         source: game.assets.videos.length ? game.assets.videos[0] : ""
  5.         anchors.fill: parent
  6.         fillMode: VideoOutput.PreserveAspectCrop
  7.         muted: true
  8.         loops: MediaPlayer.Infinite
  9.         autoPlay: true
  10.       }
  11.     }
  12.     Loader {
  13.       id: videoPreviewLoader
  14.       asynchronous: true
  15.       anchors {
  16.         fill: parent
  17.         margins: vpx(3)
  18.       }
  19.       z: 3
  20.     }
  21.  
  22. ...
  23.  
  24.   onSelectedChanged: {
  25.     if (selected) {
  26.       videoDelay.restart();
  27.     }
  28.     else {
  29.       videoPreviewLoader.sourceComponent = undefined;
  30.     }
  31.   }
  32.  
  33. ...
  34.  
  35.   Timer {
  36.     id: videoDelay
  37.     interval: 300
  38.     onTriggered: {
  39.       if (selected && game.assets.videos.length) {
  40.         videoPreviewLoader.sourceComponent = videoPreviewWrapper;
  41.       }
  42.     }
  43.   }
RAW Paste Data