当前位置: 首页>>代码示例>>Java>>正文


Java VideoEditedInfo类代码示例

本文整理汇总了Java中org.telegram.messenger.VideoEditedInfo的典型用法代码示例。如果您正苦于以下问题:Java VideoEditedInfo类的具体用法?Java VideoEditedInfo怎么用?Java VideoEditedInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


VideoEditedInfo类属于org.telegram.messenger包,在下文中一共展示了VideoEditedInfo类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sendButtonPressed

import org.telegram.messenger.VideoEditedInfo; //导入依赖的package包/类
@Override
public void sendButtonPressed(int index, VideoEditedInfo videoEditedInfo) {
    if (selectedPhotos.isEmpty()) {
        if (selectedAlbum != null) {
            if (index < 0 || index >= selectedAlbum.photos.size()) {
                return;
            }
            MediaController.PhotoEntry photoEntry = selectedAlbum.photos.get(index);
            photoEntry.editedInfo = videoEditedInfo;
            addToSelectedPhotos(photoEntry, -1);
        } else {
            ArrayList<MediaController.SearchImage> array;
            if (searchResult.isEmpty() && lastSearchString == null) {
                array = recentImages;
            } else {
                array = searchResult;
            }
            if (index < 0 || index >= array.size()) {
                return;
            }
            addToSelectedPhotos(array.get(index), -1);
        }
    }
    sendSelectedPhotos();
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:26,代码来源:PhotoPickerActivity.java

示例2: sendMedia

import org.telegram.messenger.VideoEditedInfo; //导入依赖的package包/类
public void sendMedia(MediaController.PhotoEntry photoEntry, VideoEditedInfo videoEditedInfo) {
    if (photoEntry.isVideo) {
        if (videoEditedInfo != null) {
            SendMessagesHelper.prepareSendingVideo(photoEntry.path, videoEditedInfo.estimatedSize, videoEditedInfo.estimatedDuration, videoEditedInfo.resultWidth, videoEditedInfo.resultHeight, videoEditedInfo, dialog_id, replyingMessageObject, photoEntry.caption != null ? photoEntry.caption.toString() : null, photoEntry.ttl);
        } else {
            SendMessagesHelper.prepareSendingVideo(photoEntry.path, 0, 0, 0, 0, null, dialog_id, replyingMessageObject, photoEntry.caption != null ? photoEntry.caption.toString() : null, photoEntry.ttl);
        }
        showReplyPanel(false, null, null, null, false);
        DraftQuery.cleanDraft(dialog_id, true);
    } else {
        if (photoEntry.imagePath != null) {
            SendMessagesHelper.prepareSendingPhoto(photoEntry.imagePath, null, dialog_id, replyingMessageObject, photoEntry.caption, photoEntry.stickers, null, photoEntry.ttl);
            showReplyPanel(false, null, null, null, false);
            DraftQuery.cleanDraft(dialog_id, true);
        } else if (photoEntry.path != null) {
            SendMessagesHelper.prepareSendingPhoto(photoEntry.path, null, dialog_id, replyingMessageObject, photoEntry.caption, photoEntry.stickers, null, photoEntry.ttl);
            showReplyPanel(false, null, null, null, false);
            DraftQuery.cleanDraft(dialog_id, true);
        }
    }
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:22,代码来源:ChatActivity.java

示例3: sendButtonPressed

import org.telegram.messenger.VideoEditedInfo; //导入依赖的package包/类
@Override
public void sendButtonPressed(int index, VideoEditedInfo videoEditedInfo) {
    if (index < 0 || index >= botContextResults.size()) {
        return;
    }
    sendBotInlineResult((TLRPC.BotInlineResult) botContextResults.get(index));
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:8,代码来源:ChatActivity.java

示例4: getCurrentVideoEditedInfo

import org.telegram.messenger.VideoEditedInfo; //导入依赖的package包/类
private VideoEditedInfo getCurrentVideoEditedInfo() {
    if (!isCurrentVideo || currentPlayingVideoFile == null || compressionsCount == 0) {
        return null;
    }
    VideoEditedInfo videoEditedInfo = new VideoEditedInfo();
    videoEditedInfo.startTime = startTime;
    videoEditedInfo.endTime = endTime;
    videoEditedInfo.rotationValue = rotationValue;
    videoEditedInfo.originalWidth = originalWidth;
    videoEditedInfo.originalHeight = originalHeight;
    videoEditedInfo.bitrate = bitrate;
    videoEditedInfo.originalPath = currentPlayingVideoFile.getAbsolutePath();
    videoEditedInfo.estimatedSize = estimatedSize;
    videoEditedInfo.estimatedDuration = estimatedDuration;

    if (!muteVideo && (compressItem.getTag() == null || selectedCompression == compressionsCount - 1)) {
        videoEditedInfo.resultWidth = originalWidth;
        videoEditedInfo.resultHeight = originalHeight;
        videoEditedInfo.bitrate = muteVideo ? -1 : originalBitrate;
        videoEditedInfo.muted = muteVideo;
    } else {
        if (muteVideo) {
            selectedCompression = 1;
            updateWidthHeightBitrateForCompression();
        }
        videoEditedInfo.resultWidth = resultWidth;
        videoEditedInfo.resultHeight = resultHeight;
        videoEditedInfo.bitrate = muteVideo ? -1 : bitrate;
        videoEditedInfo.muted = muteVideo;
    }
    return videoEditedInfo;
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:33,代码来源:PhotoViewer.java

示例5: setPhotoChecked

import org.telegram.messenger.VideoEditedInfo; //导入依赖的package包/类
@Override
public int setPhotoChecked(int index, VideoEditedInfo videoEditedInfo) {
    boolean add = true;
    if (index < 0 || index >= MediaController.allMediaAlbumEntry.photos.size()) {
        return -1;
    }
    int num;

    MediaController.PhotoEntry photoEntry = MediaController.allMediaAlbumEntry.photos.get(index);
    if ((num = photoAttachAdapter.addToSelectedPhotos(photoEntry, -1)) == -1) {
        num = photoAttachAdapter.selectedPhotosOrder.indexOf(photoEntry.imageId);
    } else {
        add = false;
        photoEntry.editedInfo = null;
    }
    photoEntry.editedInfo = videoEditedInfo;

    int count = attachPhotoRecyclerView.getChildCount();
    for (int a = 0; a < count; a++) {
        View view = attachPhotoRecyclerView.getChildAt(a);
        if (view instanceof PhotoAttachPhotoCell) {
            int tag = (Integer) view.getTag();
            if (tag == index) {
                ((PhotoAttachPhotoCell) view).setChecked(num, add, false);
                break;
            }
        }
    }
    updatePhotosButton();
    return num;
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:32,代码来源:ChatAttachAlert.java

示例6: sendButtonPressed

import org.telegram.messenger.VideoEditedInfo; //导入依赖的package包/类
@Override
public void sendButtonPressed(int index, VideoEditedInfo videoEditedInfo) {
    if (photoAttachAdapter.selectedPhotos.isEmpty()) {
        if (index < 0 || index >= MediaController.allMediaAlbumEntry.photos.size()) {
            return;
        }
        MediaController.PhotoEntry photoEntry = MediaController.allMediaAlbumEntry.photos.get(index);
        photoEntry.editedInfo = videoEditedInfo;
        photoAttachAdapter.addToSelectedPhotos(photoEntry, -1);
    }
    delegate.didPressedButton(7);
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:13,代码来源:ChatAttachAlert.java

示例7: setPhotoChecked

import org.telegram.messenger.VideoEditedInfo; //导入依赖的package包/类
@Override
public int setPhotoChecked(int index, VideoEditedInfo videoEditedInfo) {
    return -1;
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:5,代码来源:PhotoViewer.java

示例8: requestVideoPreview

import org.telegram.messenger.VideoEditedInfo; //导入依赖的package包/类
private void requestVideoPreview(int request) {
    if (videoPreviewMessageObject != null) {
        MediaController.getInstance().cancelVideoConvert(videoPreviewMessageObject);
    }
    boolean wasRequestingPreview = requestingPreview && !tryStartRequestPreviewOnFinish;
    requestingPreview = false;
    loadInitialVideo = false;
    progressView.setVisibility(View.INVISIBLE);
    if (request == 1) {
        if (selectedCompression == compressionsCount - 1) {
            tryStartRequestPreviewOnFinish = false;
            if (!wasRequestingPreview) {
                preparePlayer(currentPlayingVideoFile, false, false);
            } else {
                progressView.setVisibility(View.VISIBLE);
                loadInitialVideo = true;
            }
        } else {
            requestingPreview = true;
            releasePlayer();
            if (videoPreviewMessageObject == null) {
                TLRPC.TL_message message = new TLRPC.TL_message();
                message.id = 0;
                message.message = "";
                message.media = new TLRPC.TL_messageMediaEmpty();
                message.action = new TLRPC.TL_messageActionEmpty();
                videoPreviewMessageObject = new MessageObject(message, null, false);
                videoPreviewMessageObject.messageOwner.attachPath = new File(FileLoader.getInstance().getDirectory(FileLoader.MEDIA_DIR_CACHE), "video_preview.mp4").getAbsolutePath();
                videoPreviewMessageObject.videoEditedInfo = new VideoEditedInfo();
                videoPreviewMessageObject.videoEditedInfo.rotationValue = rotationValue;
                videoPreviewMessageObject.videoEditedInfo.originalWidth = originalWidth;
                videoPreviewMessageObject.videoEditedInfo.originalHeight = originalHeight;
                videoPreviewMessageObject.videoEditedInfo.originalPath = currentPlayingVideoFile.getAbsolutePath();
            }
            long start = videoPreviewMessageObject.videoEditedInfo.startTime = startTime;
            long end = videoPreviewMessageObject.videoEditedInfo.endTime = endTime;
            if (start == -1) {
                start = 0;
            }
            if (end == -1) {
                end = (long) (videoDuration * 1000);
            }
            if (end - start > 5000000) {
                videoPreviewMessageObject.videoEditedInfo.endTime = start + 5000000;
            }
            videoPreviewMessageObject.videoEditedInfo.bitrate = bitrate;
            videoPreviewMessageObject.videoEditedInfo.resultWidth = resultWidth;
            videoPreviewMessageObject.videoEditedInfo.resultHeight = resultHeight;
            if (!MediaController.getInstance().scheduleVideoConvert(videoPreviewMessageObject, true)) {
                tryStartRequestPreviewOnFinish = true;
            }
            requestingPreview = true;
            progressView.setVisibility(View.VISIBLE);
        }
    } else {
        tryStartRequestPreviewOnFinish = false;
        if (request == 2) {
            preparePlayer(currentPlayingVideoFile, false, false);
        }
    }
    containerView.invalidate();
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:63,代码来源:PhotoViewer.java

示例9: onActivityResult

import org.telegram.messenger.VideoEditedInfo; //导入依赖的package包/类
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (resultCode == Activity.RESULT_OK) {
        if (requestCode == 13) {
            PhotoViewer.getInstance().setParentActivity(parentFragment.getParentActivity());
            int orientation = 0;
            try {
                ExifInterface ei = new ExifInterface(currentPicturePath);
                int exif = ei.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
                switch (exif) {
                    case ExifInterface.ORIENTATION_ROTATE_90:
                        orientation = 90;
                        break;
                    case ExifInterface.ORIENTATION_ROTATE_180:
                        orientation = 180;
                        break;
                    case ExifInterface.ORIENTATION_ROTATE_270:
                        orientation = 270;
                        break;
                }
            } catch (Exception e) {
                FileLog.e(e);
            }
            final ArrayList<Object> arrayList = new ArrayList<>();
            arrayList.add(new MediaController.PhotoEntry(0, 0, 0, currentPicturePath, orientation, false));
            PhotoViewer.getInstance().openPhotoForSelect(arrayList, 0, 1, new PhotoViewer.EmptyPhotoViewerProvider() {
                @Override
                public void sendButtonPressed(int index, VideoEditedInfo videoEditedInfo) {
                    String path = null;
                    MediaController.PhotoEntry photoEntry = (MediaController.PhotoEntry) arrayList.get(0);
                    if (photoEntry.imagePath != null) {
                        path = photoEntry.imagePath;
                    } else if (photoEntry.path != null) {
                        path = photoEntry.path;
                    }
                    Bitmap bitmap = ImageLoader.loadBitmap(path, null, 800, 800, true);
                    processBitmap(bitmap);
                }

                @Override
                public boolean allowCaption() {
                    return false;
                }

                @Override
                public boolean canScrollAway() {
                    return false;
                }
            }, null);
            AndroidUtilities.addMediaToGallery(currentPicturePath);
            currentPicturePath = null;
        } else if (requestCode == 14) {
            if (data == null || data.getData() == null) {
                return;
            }
            startCrop(null, data.getData());
        }
    }
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:59,代码来源:AvatarUpdater.java

示例10: sendButtonPressed

import org.telegram.messenger.VideoEditedInfo; //导入依赖的package包/类
@Override
public void sendButtonPressed(int index, VideoEditedInfo videoEditedInfo) {

}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:5,代码来源:PhotoViewer.java


注:本文中的org.telegram.messenger.VideoEditedInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。