ios - Video Streaming in TableViewCell -


i designing table view consist of video streaming in it. first of all, think of application video streaming application. there video queries , users watch them. question i'm downloading videos in table view cell, therefore whenever user scrolls video, starts download. after going video , turning first 1 again, downloads first video again. not efficient both user , our backend. how can solve problem? maybe save part of videos in temporary memory. since developing application first time, feel free give advice.

here table view cell code snippet.

func explore() { var asset = avasset(url: tablevideourl)         var playeritem = avplayeritem(asset: asset)         var player = avplayer(playeritem: playeritem)         var playerlayer = avplayerlayer(player: player)         playerlayer.frame = newrect         playerlayer.videogravity = avlayervideogravityresizeaspect         contentview.layer.addsublayer(playerlayer)         player.play()  } 


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -