def _do_video_load(self, *largs): if self._video: self._video.stop() if not self.source: self._video = None self.texture = None else: filename = resource_find(self.source) self._video = CoreVideo(filename=filename, **self.options) self._video.bind(on_load=self._on_video_frame, on_frame=self._on_video_frame, on_eos=self._on_eos) if self.play: self._video.play() self.duration = 1. self.position = 0.
def _do_video_load(self, *largs): if self._video: self._video.stop() if not self.source: self._video = None self.texture = None else: filename = self.source # FIXME make it extensible. if filename.split(':')[0] not in ('http', 'https', 'file', 'udp', 'rtp', 'rtsp'): filename = resource_find(filename) self._video = CoreVideo(filename=filename, **self.options) self._video.bind(on_load=self._on_video_frame, on_frame=self._on_video_frame, on_eos=self._on_eos) if self.play: self._video.play() self.duration = 1. self.position = 0.
def _do_video_load(self, *largs): if CoreVideo is None: return self.unload() if not self.source: self._video = None self.texture = None else: filename = self.source # Check if filename is not url if '://' not in filename: filename = resource_find(filename) self._video = CoreVideo(filename=filename, **self.options) self._video.volume = self.volume self._video.bind(on_load=self._on_load, on_frame=self._on_video_frame, on_eos=self._on_eos) if self.state == 'play' or self.play: self._video.play() self.duration = 1. self.position = 0.