简体   繁体   English

在AVPlayer上绘图

[英]Drawing on AVPlayer

I'm having a video, on which I want my users to draw on the video. 我正在播放视频,希望用户在该视频上绘画。 I'm able to achieve that. 我能够做到。 However, when the device orientation gets changed, the drawing gets distorted. 但是,当更改设备方向时,图形会变形。 The demo source code can be found from below link: 演示源代码可以从下面的链接中找到:

https://www.dropbox.com/s/hkrmqgplgfd53mo/DrawPathOnVideo%204.zip?dl=0 https://www.dropbox.com/s/hkrmqgplgfd53mo/DrawPathOnVideo%204.zip?dl=0

The goal I want to achieve is to allow users draw on AVPlayer, when the video is paused. 我要实现的目标是允许用户在视频暂停时使用AVPlayer绘图。 When the video is played again, the images should appear at that time. 再次播放视频时,图像应在此时出现。 Any ready mode controls, if available?? 是否有任何就绪模式控件?

You have to store the x,y coordinates of the shape with particular time inside database. 您必须将特定时间的形状的x,y坐标存储在数据库中。

And when you play the video at that time you have to draw that shape again based on x, y coordinate. 当您在那时播放视频时,您必须再次基于x,y坐标绘制该形状。 When you change the orientation at that time you have to apply some maths for the same. 当您在那时改变方向时,您必须为此应用一些数学。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM