{"id":5778,"date":"2024-03-06T12:01:59","date_gmt":"2024-03-06T10:01:59","guid":{"rendered":"https:\/\/unitycoder.com\/blog\/?p=5778"},"modified":"2024-03-07T11:15:33","modified_gmt":"2024-03-07T09:15:33","slug":"custom-unity-hub-project-template-preview-image-video-using-htmlcss-in-package-description","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2024\/03\/06\/custom-unity-hub-project-template-preview-image-video-using-htmlcss-in-package-description\/","title":{"rendered":"Custom Unity Hub Project Template Preview Image\/Video (using HTML+CSS in package description)"},"content":{"rendered":"\n<p><strong>Steps<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Customize your project template package.json file (using 7zip in Administrator mode)<\/li>\n\n\n\n<li>Project templates are inside Unity editor installation folder (like: 2022_3\\Editor\\Data\\Resources\\PackageManager\\ProjectTemplates\\)<\/li>\n\n\n\n<li>Example package.json here to add video (and hide default preview image)<br><a href=\"https:\/\/gist.github.com\/unitycoder\/cc472faec83f4941d032e2010ce889ea\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/gist.github.com\/unitycoder\/cc472faec83f4941d032e2010ce889ea<\/a><\/li>\n\n\n\n<li>Remember to close Hub completely (so that it reloads packages)<\/li>\n\n\n\n<li>Whats happening? This line has HTML &amp; CSS inside description and Unity hub renders them.. The CSS is for hiding default project template thumbnail.<br><code>\"description\": \"Some description here.. &lt;video width='320' height='240' autoplay style=''&gt;&lt;source src='https:\/\/cdn.mtdv.me\/video\/rick.mp4' type='video\/mp4'&gt;&lt;\/video&gt;&lt;style&gt;.template-preview__image{display:none !important;}&lt;\/style&gt;\",<\/code><\/li>\n<\/ul>\n\n\n\n<p><strong>WARNING<\/strong>!<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>This means, if you download custom project templates from web\/unknown sources, they might &#8220;call home&#8221; with custom html running on template selection.. (capture your IP address or possible more..) **I did report this to Unity Bug Bounty earlier, but got reply that its not applicable..<\/li>\n<\/ul>\n\n\n\n<p><strong>VIDEO<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<span class=\"embed-youtube\" style=\"text-align:center; display: block;\"><iframe loading=\"lazy\" class=\"youtube-player\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/rDztss585fY?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent\" allowfullscreen=\"true\" style=\"border:0;\" sandbox=\"allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox\"><\/iframe><\/span>\n<\/div><\/figure>\n\n\n\n<p><strong>forum post: <\/strong><br><a href=\"https:\/\/forum.unity.com\/threads\/workaround-custom-icon-and-preview-image-for-your-new-project-templates.1554800\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/forum.unity.com\/threads\/workaround-custom-icon-and-preview-image-for-your-new-project-templates.1554800\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Steps WARNING! VIDEO forum post: https:\/\/forum.unity.com\/threads\/workaround-custom-icon-and-preview-image-for-your-new-project-templates.1554800\/<\/p>\n","protected":false},"author":1,"featured_media":5779,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":false,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1267],"tags":[568,1281,1280,1236,388,802,171,740],"class_list":["post-5778","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-unityhub","tag-custom","tag-description","tag-html","tag-hub","tag-project","tag-template","tag-unity","tag-video"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2024\/03\/ssprojecttemplate2024-03-06-11-39-57.jpg?fit=1920%2C1080&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-1vc","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/5778","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/comments?post=5778"}],"version-history":[{"count":5,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/5778\/revisions"}],"predecessor-version":[{"id":5786,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/5778\/revisions\/5786"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/5779"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=5778"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=5778"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=5778"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}