Webgl unity build won't play Video - Stack Overflow

文章推薦指數: 80 %
投票人數:10人

videoPlayer.url = System.IO.Path.Combine (Application.streamingAssetsPath,"myFile.mp4");. You can use other videoplayer commands like Video.Play ... Home Public Questions Tags Users Companies Collectives ExploreCollectives Teams StackOverflowforTeams –Startcollaboratingandsharingorganizationalknowledge. CreateafreeTeam WhyTeams? Teams CreatefreeTeam Collectives™onStackOverflow Findcentralized,trustedcontentandcollaboratearoundthetechnologiesyouusemost. Learnmore Teams Q&Aforwork Connectandshareknowledgewithinasinglelocationthatisstructuredandeasytosearch. Learnmore Webglunitybuildwon'tplayVideo AskQuestion Asked 3years,4monthsago Modified 8monthsago Viewed 20ktimes 6 3 Ihaveusedvideoplayertoplayvideo,everythingworksfineinunitybutwhenIbuilditandrunonfirefoxoranyotherbrowser,thevideowon'tplay.Ihavetrieddifferentsettingsanddifferentvideoformatsbutnothingseemstowork.Idon'tgetanyerrors. Ihaveanemptyscenewithcameraandvideoplayer,noscripts.Justusedvideoplayerandusedplayonawaketoplaythevideo. Worksfineinplaymodebutwon'tworkinwebglbuild. unity3dvideohtml5-videounity-webgl Share Improvethisquestion Follow editedJul17,2020at22:49 Dharman♦ 27.3k2121goldbadges7474silverbadges125125bronzebadges askedFeb24,2019at20:45 JzKonainJzKonain 18911goldbadge11silverbadge88bronzebadges 4 WebGLdoesnotsupportMovieTextures. – Draco18snolongertrustsSE Feb25,2019at1:28 @Draco18showtoplayavideoinwebglthen? – JzKonain Feb25,2019at4:39 AfterLotsofeffortandinternetresearchfoundasolutioninthecomments.IneditorcreateafolderwiththenameStreamingAssetsandputyourvideofileintothen(thevideoformatIusesis.mp4);script:CreateaVideoPlayercomponentandassigninaplancaseneedsvideoinsceneorcameraifyouneedvideofullscreen;Usethiscommandtocombinethestreamingassetspathwiththevideofilenameandextension:videoPlayer.url=System.IO.Path.Combine(Application.streamingAssetsPath,"myFile.mp4");and,callplaymode:videoPlayer.Play(); – JzKonain Feb25,2019at6:12 Createananswer.:) – Draco18snolongertrustsSE Feb25,2019at14:14 Addacomment  |  1Answer 1 Sortedby: Resettodefault Highestscore(default) Trending(recentvotescountmore) Datemodified(newestfirst) Datecreated(oldestfirst) 11 IntheeditorcreateafolderwiththenameStreamingAssetsandputyourvideofilesintothatfolder.ThevideoformatthatIusedismp4.CreateaVideoPlayercomponentandattachittoagameobject.Referencethatcomponentinascriptandusethefollowingcommand videoPlayer.url=System.IO.Path.Combine(Application.streamingAssetsPath,"myFile.mp4"); YoucanuseothervideoplayercommandslikeVideo.Play();toplaythevideo. Share Improvethisanswer Follow editedApr17,2020at20:44 AdrianMole 44.3k117117goldbadges4545silverbadges7373bronzebadges answeredMar5,2019at21:39 JzKonainJzKonain 18911goldbadge11silverbadge88bronzebadges 7 1 Iusedthissolutionandnowthefirstframeofmyvideoisshowing,butthevideodoesn'tactuallyplay... – Truth Apr17,2020at13:25 @Truthdidyoufindasolutiontothis? – cyo Aug26,2020at16:46 Itisgoodsolution,thanks.ButitisworthtomentionthattheremayalsobesomeadditionaltroubleswhentryingtoplayvideosinMicrosoftEdgebrowser.InmycaseIwasonlyabletoplayvideoswhenIhavecreatedlocalHTTPserverinPythonandopenedWebGLUnityprojectinFirefox.WhenIdidthesamethingearlieronMicrosoftEdgebrowser,Ihadonlyblackscreenandaudioplaying,butnotworkingvideo-evenafterapplyingthissolutioninmyscript. – westman379 Nov24,2020at11:15 1 @Truth-IranintothisissueinChrome(afterfixingtheinitialissuethisquestionisabout).TheissuestemsfromChromerefusingtoplayvideo/soundwithouttheuserfirsthavinginteractedwiththegame.Mysolutionwastoaddanewsceneatthestartthatforcestheusertoclickbeforecontinuingontothe"true"startingscene.Hopethathelps! – MicahCowan Feb12,2021at10:05 @cyoseetheaboveanswerforthefirst-frame-onlyproblem^ – MicahCowan Feb12,2021at10:06  |  Show2morecomments Highlyactivequestion.Earn10reputation(notcountingtheassociationbonus)inordertoanswerthisquestion.Thereputationrequirementhelpsprotectthisquestionfromspamandnon-answeractivity. Nottheansweryou'relookingfor?Browseotherquestionstaggedunity3dvideohtml5-videounity-webgloraskyourownquestion. TheOverflowBlog Codecompletionisn’tmagic;itjustfeelsthatway(Ep.464) HowAPIscantakethepainoutoflegacysystemheadaches(Ep.465) FeaturedonMeta AnnouncingtheStacksEditorBetarelease! Trending:Anewanswersortingoption The[options]tagisbeingburninated Related 227 Play/pauseHTML5videousingJQuery 180 changingsourceonhtml5videotag 1 isitpossibletoplayvideowithunitywebglonmobiledevices 0 SceneManager.LoadScene/LoadSceneAsyncloadsemptyscene(WebGL)Unity5.6 20 HowdoIrunalocalUnityWebGL(file://url)build? 1 UnityWebGLvideofileformat 3 ModifyUnityWebGLBuildURL 0 UnityWebGLBuildonBrightSignPlayerstuckloading 0 `CantUploadWebGLbuildinunity HotNetworkQuestions Howdidthisnotehelppreviousownerofthisoldfilmcamera? Lookingforamiddlegroundbetweenrawrandomandshufflebags Howtoencouragemeleecombatwhenrangedisastrongeroption Numberofdivisorsequalssquareroot HowshouldIdealwithcoworkersnotrespectingmyblockingofftimeinmycalendarforwork? IsthereaPRNGthatvisitseverynumberexactlyonce,inanon-trivialbitspace,withoutrepetition,withoutlargememoryusage,beforeitcycles? Whatarethe"disks"seenonthewallsofsomeNASAspaceshuttles? HowdotheelectricalcharacteristicsofanADCdegradeoverlifetime? What'sinsidetheSPIKEEssentialsmallangularmotor? Canahumancolonybeself-sustainingwithoutsunlightusingmushrooms? WhatshouldIdowhensomeonepublishesapaperbasedonresultsIalreadypostedontheinternet? WhatisthesignificanceofthescenewhereGushadalongconversationwithamanatabarinS06E09? HowCIDRhelpedtoslowdownroutingtablegrowth? WhatisthedifferencebetweenErrorMitigation(EM)andQuantumErrorCorrection(QEC)? Whydocolderclimateshavemoreruggedcoasts? Howtoavoidparadoxesabouttime-orderingoperation? ConvertnumericstringtoRomannumeral mvfailswith"Nospaceleftondevice"whenthedestinationhas31GBofspaceremaining Minimizingunderargminconstraint Presidentiallineofsuccessionandage Alternativestorimtape Ifacreature'sonlyfoodsourcewas4,000feetaboveit,andonlyrarelyfellfromthatheight,howwoulditevolvetoeatthatfood? Ismoderatedlivestockgrazinganeffectivecountermeasurefordesertification? Coverlettertoarticlesubmittedbysomeonebesidesthecorrespondingauthor morehotquestions Questionfeed SubscribetoRSS Questionfeed TosubscribetothisRSSfeed,copyandpastethisURLintoyourRSSreader. Yourprivacy Byclicking“Acceptallcookies”,youagreeStackExchangecanstorecookiesonyourdeviceanddiscloseinformationinaccordancewithourCookiePolicy. Acceptallcookies Customizesettings  



請為這篇文章評分?