Table of Contents

Upgrading from AVPro Video 1.x

If you have existing projects based on the legacy AVPro Video 1.x product, it is possible to upgrade them to AVPro Video 2.x using the steps below.

Note

It is not possible to have AVPro Video 1.x and 2.x within the same project as there would be conflicts.

Upgrading projects is not something we recommend as there have been a lot of changes between the two API versions. Before starting this process we recommend having a backup or source control for your project.

Scenes, Prefabs and Scripts

Existing scenes and prefabs should mostly upgrade correctly, as we have created serialisation fixups for most properties. Existing scripts will need to be manually updated to the new API using the reference below.

Upgrading

  1. Close Unity and open your project up fresh (otherwise some of the plugin files will be locked if you have used the AVPro Video scripts or plugins during your editor session, which will prevent them from being deleted)
  2. The old AVPro Video package must be deleted: 1. Delete the old AVPro Video plugins folder (usually found at Assets/Plugins). When you do this you must be careful that you don't have other files in there from other packages. 2. Delete the old AVPro Video main folder (usually found at Assets/AVProVideo) 3. Optionally delete the old sample videos folder (usually found in /Assets/StreamingAssets/AVProVideoSamples)
  3. Import the latest AVPro Video 2.x package
  4. Fix script compile issues in your project using the list of API changes below

API Changes

A non-exhaustive list of API changes:

Legacy 1.x New 2.x Notes

Types
class CubemapCube Removed
class DisplayBackground Removed
class DisplayBackground Removed
class DebugOverlay Removed
class UpdateStereoMaterial class UpdateMultiPassStereo
class ApplyToTextureWidgetNGUI Removed
enum MediaPlayer.FileLocation enum MediaPathType

Fields
MediaPlayer.m_VideoPath MediaPlayer.MediaPath.Path Loading Notes
MediaPlayer.m_VideoLocation MediaPlayer.MediaPath.PathType Loading Notes
MediaPlayer.m_AutoOpen MediaPlayer.AutoOpen
MediaPlayer.m_AutoStart MediaPlayer.AutoStart
MediaPlayer.m_Loop MediaPlayer.Loop
MediaPlayer.m_Volume MediaPlayer.AudioVolume
MediaPlayer.m_Balance MediaPlayer.AudioBalance
MediaPlayer.m_Muted MediaPlayer.AudioMuted
MediaPlayer.m_PlaybackRate MediaPlayer.PlaybackRate
MediaPlayer.m_Resample MediaPlayer.UseResampler
MediaPlayer.m_ResampleMode MediaPlayer.ResampleMode
MediaPlayer.m_ResampleBufferSize MediaPlayer.ResampleBufferSize
MediaPlayer.m_StereoPacking Replaced with FallbackMediaHints
MediaPlayer.m_AlphaPacking Replaced with FallbackMediaHints
MediaPlayer.m_DisplayDebugStereoColorTint Removed
MediaPlayer.m_FilterMode MediaPlayer.TextureFilterMode
MediaPlayer.m_WrapMode MediaPlayer.TextureWrapMode
MediaPlayer.m_AnisoLevel MediaPlayer.TextureAnisoLevel
MediaPlayer.m_LoadSubtitles MediaPlayer.SideloadSubtitles
DisplayUGUI._mediaPlayer DisplayUGUI.CurrentMediaPlayer
DisplayIMGUI._mediaPlayer DisplayIMGUI.Player
DisplayIMGUI._color DisplayIMGUI.Color

Methods
MediaPlayer.OpenVideoFromFile() MediaPlayer.OpenMedia()
MediaPlayer.CloseVideo() MediaPlayer.CloseMedia()
MediaPlayer.OpenVideoFromBuffer() MediaPlayer.OpenMediaFromBuffer()
MediaPlayer.StartOpenChunkedVideoFromBuffer() MediaPlayer.StartOpenChunkedMediaFromBuffer()
IMediaInfo.GetDurationMs() IMediaInfo.GetDuration() Time format changes
IMediaInfo.GetAudioTrackCount() IAudioTracks.GetAudioTracks().Count Tracks
IMediaControl.GetCurrentTimeMs() IMediaControl.GetCurrentTime() Time format changes
IMediaControl.GetBufferingProgress() No replacement
IMediaControl.GetBufferedTimeRange() Time Ranges
IMediaControl.GetBufferedTimeRangeCount() IMediaControl.GetBufferedTimes().Count Time Ranges
IMedaControl.SetAudioTrack() IAudioTracks.SetActiveAudioTrack() Tracks

Time

All time values have changed from 32-bit float milliseconds, to 64-bit double seconds.

Tracks

	int trackCount = mediaPlayer.AudioTracks.GetAudioTracks().Count;
	AudioTrack track = mediaPlayer.AudioTracks.GetAudioTracks()[index];
	mediaPlayer.AudioTracks.SetActiveAudioTrack(track);

Media Hints

	MediaHints hints = mediaPlayer.FallbackMediaHints;
	hints.stereoPacking = StereoPacking.None;
	mediaPlayer.FallbackMediaHints = hints;

Time Ranges

	int bufferZones = IMediaControl.GetBufferedTimes().Count
	TimeRange range = IMediaControl.GetBufferedTimes()[0];

PlayMaker

PlayMaker actions from AVPro Video 1.x are not included in 2.x

Other Changes

Without going into detail, other API changes include:

  1. Custom HTTP headers
  2. Setting audio output mode
  3. macOS, iOS and tvOS have been unified, so most mentions of 'MacOSX' have been replaced with 'Apple'