Hi railon,
Here is how you can fix the iOS 9.2 issue on the VideoPlayback sample apps, native and Unity (without having to split the audio from the video, as you did):
Native Videoplayback sample fix:
Edit the file VideoPlayerHelper.m; the color-highlitghted lines below are the ones to be added to the original code:
switch (status) {
case AVPlayerItemStatusUnknown:
DEBUGLOG(@"AVPlayerItemStatusObservationContext -> AVPlayerItemStatusUnknown");
if (mediaState != PLAYING) { // ADD THIS LINE
mediaState = NOT_READY;
}// ADD THIS LINE
break;
case AVPlayerItemStatusReadyToPlay:
DEBUGLOG(@"AVPlayerItemStatusObservationContext -> AVPlayerItemStatusReadyToPlay");
if (mediaState != PLAYING) { // ADD THIS LINE
mediaState = READY;
} // ADD THIS LINE
Unity Videoplayback sample:
(same code change but slightly more involved process)
In this case you need to edit the source code of the VuforiaMedia plugin which is located under /Assets/Plugins/iOS/VuforiaMedia in the VP Unity sample project
· Rename the VideoPlayerHelper.m.txt to VideoPlayerHelper.m
· Rename the VideoPlayerWrapper.mm.txt to VideoPlayerWraper.mm
· Open the Xcode project in the VuforiaMedia folder
· Edit the file VideoPlayerHelper.m; the color-highlitghted lines below are the ones to be added to the original code:
switch (status) {
case AVPlayerItemStatusUnknown:
DEBUGLOG(@"AVPlayerItemStatusObservationContext -> AVPlayerItemStatusUnknown");
if (mediaState != PLAYING) { // ADD THIS LINE
mediaState = NOT_READY;
} // ADD THIS LINE
break;
case AVPlayerItemStatusReadyToPlay:
DEBUGLOG(@"AVPlayerItemStatusObservationContext -> AVPlayerItemStatusReadyToPlay");
if (mediaState != PLAYING) { // ADD THIS LINE
mediaState = READY;
} // ADD THIS LINE
· Build the Xcode project
· Locate the libVuforiaMedia.a generated by Xcode upon build completion, and copy it to the Assets/Plugins/iOS folder (overwrite the existing one)
· Close the Xcode project
· Rename VideoPlayerHelper.m back to VideoPlayerHelper.m.txt
· Rename the VideoPlayerWrapper.mm back to VideoPlayerWraper.mm.txt
· Refresh and rebuild the VideoPlayback sample Unity project
Indeed, you need to select a Device (and not the iOS Simulator) to build the libVuforiaMedia project.