Video preview in a chat like app


#1

I have created a chat like app that allows user send video. im using videoplayer plugin to view the video.

Is there a way to show a video preview image like whatsapp does ?


#2

I did something like this.

First, get a “poster” of your video:

<img ng-src="{{path_to_poster}}"/ ng-click="playVideo(file_id)">

and then if your controller call Ionic’s modal window:

$scope.playVideo = function(file_id) {
   $scope.modal.show();
}

that will have your video embedded (you can even use HTML5 video tag)

<video ng-src="{{file_id}}" poster="{{path_to_poster}}">

#3

Is there a way to create the video posters dynamiclly? Taken lets say from the videos first frame or etc…


#4

I am pretty sure you cannot do it with just JS. You have to implement some backend functionality for that.