cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

How to play mp4 video in HoloLens?

jcheng1
1-Newbie

How to play mp4 video in HoloLens?

How to play mp4 video in Hololens? I can't find the widget(play video) from eye-wear project. Can I use another method to play video in Hololens?

1 ACCEPTED SOLUTION

Accepted Solutions
mwassmann
5-Regular Member
(To:jcheng1)

Johnny,

as you may have noticed on hololens you have no 2D view - even in the native hololens menu you need to pin objects in the real world.


We are working on different solutions in that manner - however for now you would only have a javascript solution to draw a canvas and "paint" the video on it -> its not the way you want to play a video, it takes a lot of perfomance.

Martin

View solution in original post

3 REPLIES 3
mwassmann
5-Regular Member
(To:jcheng1)

Johnny,

as you may have noticed on hololens you have no 2D view - even in the native hololens menu you need to pin objects in the real world.


We are working on different solutions in that manner - however for now you would only have a javascript solution to draw a canvas and "paint" the video on it -> its not the way you want to play a video, it takes a lot of perfomance.

Martin

jambrose
6-Contributor
(To:mwassmann)

Hey Martin,

I realize this isn't the best way to accomplish playing a video on HoloLens, but this seems like it might be the best solution to show a short clip of stress test. Is there any documentation of the javascript solution, to draw a canvas and "paint" the video on it?

Jeff

One thing what is working for small animations is simple to have a 3dImage and to chage the pictures source via a timer event. For small animations it seems to work

2018-09-19_18-37-09.jpgSo now we can write a script 

/////////////////////////////////////////////////////////////////////////////
var global_count_int1=0;
//----- HERE IS THE ANIMATION from Server
$interval( function(){
 
if(animate ==true) // this variable is true then animate
  {
    if( global_count_int1 > 7)  global_count_int1=0;
    global_count_int1++;
    
   var url_source= "app/resources/Uploaded/pic_0"+global_count_int1+".gif";
     
    $scope.$applyAsync(function() {
      //$scope.view.wdg['3DImage-3']['source'] =url_source;
      $scope.app.params['image_url']=url_source;
      console.log("in interval url_source="+url_source);
                                  }
                      ); //end applyAsync
  }
} , 500);
/////////////////////////////////////////////////////////////////////

So this script work if the variable animate== true (could be also some value of toggle button)

In this case the script will change every half second the picture displayed on the 3DImage element.

In my test it does not work directly to set the source so I used a workaround to set a parameter which is bound on the 3d image source property

2018-09-19_18-27-35.jpg2018-09-19_18-28-06.jpg

Top Tags