Shootphoto

已完成

评论

3 条评论

  • DJI Developer Support
    You need to use KeyNewlyGeneratedMediaFile to listen for the generation of new photos, and then use the obtained index attribute to find the corresponding file in the file list in order to obtain the name of the photo. tutorial:https://developer.dji.com/doc/mobile-sdk-tutorial/en/tutorials/media-file.html
    0
    评论操作 固定链接
  • Hamoud

    I see that 

    widgetModel.startShootPhoto();  

    Is shooting photos , I tried a lot of methods to get the filename , because my goal is to download the original photo from the camera after shooting photo at the same time , so i used that function but it seems showing the same things :

    SettingMenuFragment fragment = new SettingMenuFragment();
    Bundle arguments = fragment.getArguments();
    if (arguments != null){
    mediaFile = (MediaFile) arguments.getSerializable(MEDIA_FILE_DETAILS_STR);
    if (mediaFile != null){
    String filename = mediaFile.getFileName();
    }
    }
    return widgetModel.startShootPhoto();


    What is the solution ?

     

    0
    评论操作 固定链接
  • DJI Developer Support
    In the sample, to obtain the MediaFile through arguments.getSerializable, you also need to obtain the file list through mediaFileListData and then obtain the MediaFile. You can choose the method that you think is suitable for obtaining it. If you need to generate a photo and then download it, you can try to use KeyNewlyGeneratedMediaFile to obtain the index value of the photo, then create a MediaFile to store this index value, and finally download it when the camera is in download mode. private fun onItemClick(mediaFile: MediaFile , view: View){ var imageView = view.findViewById(R.id.iv_thumbnail) as ImageView ViewCompat.setTransitionName(view, mediaFile.fileName ); val extra = FragmentNavigatorExtras( view to "tansitionImage" ) Navigation.findNavController(view).navigate( R.id.media_details_page , bundleOf( MEDIA_FILE_DETAILS_STR to mediaFile ) , null , extra)}
    0
    评论操作 固定链接

请先登录再写评论。