void SelectVideo() { #if UNITY_EDITOR Debug.Log("SelectVideo In Editor"); return; #endif NativeGallery.GetVideoFromGallery(OnGetVideoCb, "Select Video"); }
public void ChooseVideo() { NativeGallery.Permission permission = NativeGallery.GetVideoFromGallery((path) => { TargetBehavior target = FindObjectOfType <TargetBehavior>(); if (path != null && target != null) { target.OnVideoChosen(path); } }, "Select a video'"); }
/// <summary> /// Select video from native gallery /// </summary> /// <param name="path">video path</param> void PickVideo() { NativeGallery.Permission permission = NativeGallery.GetVideoFromGallery((path) => { if (path != null) { // Load picked video LoadVideo("file://" + path); } }, "Select Video"); }
private void PickVideo() { NativeGallery.Permission permission = NativeGallery.GetVideoFromGallery((path) => { Debug.Log("Video path: " + path); if (path != null) { Handheld.PlayFullScreenMovie("file://" + path); } }, "Select a Video"); Debug.Log("Permission result:" + permission); }
private void PickVideo() { NativeGallery.Permission permission = NativeGallery.GetVideoFromGallery((path) => { if (path != null) { _video.transform.GetChild(0).GetComponent <VideoPlayer>().url = "file://" + path; } }, "Escolha um video"); Debug.Log("Permission result: " + permission); }
private void PickVideo() { NativeGallery.Permission permission = NativeGallery.GetVideoFromGallery((path) => { Debug.Log("Video path: " + path); if (path != null) { StartCoroutine(LoadVideo(path)); } }, "Select a video"); Debug.Log("Permission result: " + permission); }
private void PickVideo() { NativeGallery.Permission permission = NativeGallery.GetVideoFromGallery((path) => { Debug.Log("Video path: " + path); if (path != null) { // Play the selected video playVideo("file://" + path); } }, "Select a video"); Debug.Log("Permission result: " + permission); }
public void PickVideoFromGallery() { NativeGallery.Permission permission = NativeGallery.GetVideoFromGallery((path) => { if (path != null) { // Play the selected video //Handheld.PlayFullScreenMovie("file://" + path); pathText.text = path; } }, "Select a video"); Debug.Log("Permission result: " + permission); }
private void PickVideo() { NativeGallery.Permission permission = NativeGallery.GetVideoFromGallery((path) => { Debug.Log("Ruta del video: " + path); if (path != null) { // Muestra el video seleccionado Handheld.PlayFullScreenMovie("file://" + path); } }, "Selecciona un video"); Debug.Log("Resultado de los permisos: " + permission); }
private void PickVideo() { NativeGallery.Permission permission = NativeGallery.GetVideoFromGallery((path) => { Debug.Log("Video path: " + path); if (path != null) { // Play the selected video Handheld.PlayFullScreenMovie("file://" + path); } }, "Select a video"); Debug.Log("Permission result: " + permission); CanvasToHide.SetActive(true); }
private void PickVideo() { NativeGallery.Permission permission = NativeGallery.GetVideoFromGallery((path) => { Debug.Log("Video path: " + path); statusText.text = path; uploadscript.m_LocalFileName = path; if (path != null) { // Play the selected video Handheld.PlayFullScreenMovie("file://" + path); } }, "Select a video"); Debug.Log("Permission result: " + permission); }
public void PickTrimPlay() { NativeGallery.Permission permission = NativeGallery.GetVideoFromGallery((path) => { if (path != null) { // Play the selected video config.inputPath = path; //watermarkData.inputPath = path; config.outputPath = path.Substring(0, path.Length - 4) + "_Trimmed.mp4"; //watermarkData.outputPath = path.Substring(0, path.Length - 4) + "_Trimmed.mp4"; pathNewVideoToPlay = config.outputPath; FFmpegCommands.Trim(config); //FFmpegCommands.Watermark(watermarkData); } }, "Select a video"); }
/// <summary> /// 打开相册 选择一个视频 /// </summary> public static void OpenVideo(Action <string> callBack) { NativeGallery.Permission permission = NativeGallery.GetVideoFromGallery((string path) => { if (!string.IsNullOrEmpty(path) && callBack != null) { callBack(path); } }); if (permission != NativeGallery.Permission.Granted) { ShowToast("当前没有相册访问权限,请在设置中打开"); //打开应用程序设置 if (NativeGallery.CanOpenSettings()) { NativeGallery.OpenSettings(); } } }
/// <summary> /// Pick a video from Gallery/Photos /// uses NativeGallery /// </summary> public void PickVideo() { if (NativeGallery.IsMediaPickerBusy()) { return; } NativeGallery.Permission permission = NativeGallery.GetVideoFromGallery((path) => { Debug.Log("Video path: " + path); if (path != null) { // Play the selected video Handheld.PlayFullScreenMovie("file://" + path); } }, "Select a video"); Debug.Log("Permission result: " + permission); }
/** * 打开原生相册选择 视频 */ private void IPhonePlayerSelectVideoOpenAlbum() { NativeGallery.Permission rest1 = NativeGallery.RequestIPhonePermission(4); NativeGallery.Permission rest2 = NativeGallery.RequestIPhonePermission(3); if (rest1 == NativeGallery.Permission.Granted) { NativeGallery.GetVideoFromGallery((backPath) => { if (backPath.IsNotNullAndEmpty()) { // 打开原生视频选择 UIMgr.OpenPanel <AttendanceAddPanel>(new AttendanceAddPanelData() { BoxId = mData.BoxId, BoxDay = mData.BoxDay, Path = backPath, ThumbnailPath = Application.temporaryCachePath + "/videoThumbnail.png", Action = AttendanceAdd.Video, }, UITransitionType.CIRCLE); Close(); } }, "选择视频", "video/*"); } }
public void LoadVideoInsidePicture() { NativeGallery.Permission permission = NativeGallery.GetVideoFromGallery((path) => { Debug.Log("Video path: " + path); if (path != null) { foreach (GameObject element in GameObject.FindGameObjectsWithTag("TakePictureBtn")) { element.SetActive(false); } NativeGallery.VideoProperties videoProperties = NativeGallery.GetVideoProperties(path); GameObject pictureVideo = Instantiate(Resources.Load <GameObject>("Prefabs/Picture/PictureVideo")); StreamVideo streamScript = pictureVideo.GetComponent <StreamVideo>(); pictureVideo.GetComponent <PictureController>().SetMediaPath(path); if (videoProperties.rotation == 180 || videoProperties.rotation == 0) { streamScript.SetRotationVideo(videoProperties.rotation); } else { streamScript.SetRotationVideo(videoProperties.rotation - 180); } streamScript.SetPath(path); streamScript.LoadVideoInsidePicture(); EnableButtonPhoto(); confirmSavePhotoBtn.GetComponent <SavePhotoController>().setPicture(pictureVideo); confirmCancelPhotoBtn.GetComponent <SavePhotoController>().setPicture(pictureVideo); } }, "Select a video"); Debug.Log("Permission result: " + permission); }
// launches a platform-specific Gallery browser and returns the path of the selected file private void LaunchGalleryBrowser() { NativeGallery.GetVideoFromGallery(TryImportFile, "Pick a Video", "video/*"); }