按照原作者的想法,是可以实现手机观察到播放封面,但没法点击播放。针对这个问题,我翻看了官方论坛,因为最新的unity包缺少了一个C#文件。把缺少的文件加上,可以实现播放,以下为详细说明:
The objective here is to show how to replicate the essence of the Vuforia-VideoPlayback sample scene using the Vuforia prefabs and the drag and drop approach of Unity:
- Create a new Unity project
- Import the Vuforia video playback unity package
- Create a new scene
- Drag the ARCamera prefab into the Unity scene
- Under the DataSetLoadBehaviour in the Inspector tick “Load Data Set StonesAndChips”, and the 'Activate' checkbox below this
- From '/Qualcomm AugmentedReality/Prefabs' drag the ImageTarget prefab into the scene
- For the Image Target select “StonesAndChips” as the dataset and the Image Target should change to the Stones texture
- From Vuforia Video Playback/Prefabs drag the Video prefab to be the child of the Image Target
- In the Inspector under “Video Playback Behaviour (Script)” set the path to 'VuforiaSizzleReel_1.m4v'
- Drag the TrackableEventHandler from Scripts to the Image Target (this plays the video)
- Remove the DefaultTrackableEventHandler script from the Image Target as it is not needed.
- Autoplay works already, however tapping the video does not yet work. In order to fix this, simply create a VideoPlaybackController script, fill it with the code below, and then attach this to the ARCamera.
大概意思就是(我英语不好,懂意思就好= =#,英语好的还是读上文吧):