comparison Applications/StoneWebViewer/WebApplication/app.js @ 1710:673c163e1b3e

playing videos if Orthanc is not available
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 30 Nov 2020 16:41:31 +0100
parents 2931f5e15320
children aec45e0b2528
comparison
equal deleted inserted replaced
1709:2931f5e15320 1710:673c163e1b3e
121 121
122 122
123 123
124 Vue.component('viewport', { 124 Vue.component('viewport', {
125 props: [ 'left', 'top', 'width', 'height', 'canvasId', 'active', 'content', 'viewportIndex', 125 props: [ 'left', 'top', 'width', 'height', 'canvasId', 'active', 'content', 'viewportIndex',
126 'showInfo' ], 126 'showInfo', 'globalConfiguration' ],
127 template: '#viewport-template', 127 template: '#viewport-template',
128 data: function () { 128 data: function () {
129 return { 129 return {
130 stone: stone, // To access global object "stone" from "index.html" 130 stone: stone, // To access global object "stone" from "index.html"
131 status: 'waiting', 131 status: 'waiting',
134 quality: '', 134 quality: '',
135 cineControls: false, 135 cineControls: false,
136 cineIncrement: 0, 136 cineIncrement: 0,
137 cineFramesPerSecond: 30, 137 cineFramesPerSecond: 30,
138 cineTimeoutId: null, 138 cineTimeoutId: null,
139 cineLoadingFrame: false 139 cineLoadingFrame: false,
140 videoUri: ''
140 } 141 }
141 }, 142 },
142 watch: { 143 watch: {
143 currentFrame: function(newVal, oldVal) { 144 currentFrame: function(newVal, oldVal) {
144 /** 145 /**
200 pendingSeriesPdf_[seriesInstanceUid] = true; 201 pendingSeriesPdf_[seriesInstanceUid] = true;
201 } 202 }
202 } 203 }
203 else if (newVal.series.type == stone.ThumbnailType.VIDEO) { 204 else if (newVal.series.type == stone.ThumbnailType.VIDEO) {
204 this.status = 'video'; 205 this.status = 'video';
205 console.warn('Videos are not supported by the Stone Web viewer yet'); 206 this.videoUri = '';
207 if (this.globalConfiguration.OrthancApiRoot) {
208 var that = this;
209 axios.post(that.globalConfiguration.OrthancApiRoot + '/tools/find',
210 {
211 Level : 'Instance',
212 Query : {
213 StudyInstanceUID: studyInstanceUid
214 }
215 })
216 .then(function(response) {
217 if (response.data.length != 1) {
218 throw('');
219 }
220 else {
221 that.videoUri = that.globalConfiguration.OrthancApiRoot + '/instances/' + response.data[0] + '/frames/0/raw';
222 }
223 })
224 .catch(function(error) {
225 alert('Cannot find the video in Orthanc');
226 });
227 }
228 else {
229 console.warn('Videos are not supported by the Stone Web viewer alone yet, the Orthanc REST API is needed');
230 }
206 } 231 }
207 } 232 }
208 }, 233 },
209 mounted: function() { 234 mounted: function() {
210 var that = this; 235 var that = this;