Update the metadata for the video if video has been updated in Brightcove since the bundle
        metadata was last updated.
500335
def _update_metadata_for_video(self, metadata_href, video):
        '''
        
        '''
        current_metadata = self.clarify_client.get_metadata(metadata_href)
        cur_data = current_metadata.get('data')

        if cur_data.get('updated_at') != video['updated_at']:
            self.log('Updating metadata for video {0}'.format(video['id']))
            if not self.dry_run:
                metadata = self._metadata_from_video(video)
                self.clarify_client.update_metadata(metadata_href, metadata=metadata)
            self.sync_stats['updated'] += 1
503718
def update_webhook_metadata(self, webhook, metadata):
        
        return self.manager.update_webhook_metadata(self.scaling_group, self,
                webhook, metadata)
635464
def update(self, instance, validated_data):
        
        instance.status = validated_data["status"]
        instance.client_video_id = validated_data["client_video_id"]
        instance.duration = validated_data["duration"]
        instance.save()

        # Set encoded videos
        instance.encoded_videos.all().delete()
        EncodedVideo.objects.bulk_create(
            EncodedVideo(video=instance, **video_data)
            for video_data in validated_data.get("encoded_videos", [])
        )

        # Set courses
        # NOTE: for backwards compatibility with the DRF v2 behavior,
        # we do NOT delete existing course videos during the update.
        # Also update VideoImage objects if an image filename is present
        for course_video, image_name in validated_data.get("courses", []):
            course_video.video = instance
            course_video.save()
            if image_name:
                VideoImage.create_or_update(course_video, image_name)

        return instance
917347
def update_metadata(self, bucket, label, params):
        '''
        '''
        if self.mode !="r":
            try:
                payload = self._get_bucket_md(bucket)
            except OFSFileNotFound:
                # No MD found... create it
                payload = {}
                for l in self.list_labels(bucket):
                    payload[l] = {}
                    payload[l]['_label'] = l
                if not self.quiet:
                    print("Had to create md file for %s" % bucket)
            except OFSException as e:
                raise OFSException(e)
            if not label in payload:
                payload[label] = {}
            payload[label].update(params)
            self.put_stream(bucket, MD_FILE, json.dumps(payload).encode('utf-8'), params={}, replace=True, add_md=False)
            return payload[label]
        else:
            raise OFSException("Cannot update MD in archive in 'r' mode")
728657
def update():
    '''
    
    '''

    metadata = _init()

    if S3_SYNC_ON_UPDATE:
        # sync the buckets to the local cache
        log.info('Syncing local cache from S3...')
        for saltenv, env_meta in six.iteritems(metadata):
            for bucket_files in _find_files(env_meta):
                for bucket, files in six.iteritems(bucket_files):
                    for file_path in files:
                        cached_file_path = _get_cached_file_name(bucket, saltenv, file_path)
                        log.info('%s - %s : %s', bucket, saltenv, file_path)

                        # load the file from S3 if it's not in the cache or it's old
                        _get_file_from_s3(metadata, saltenv, bucket, file_path, cached_file_path)

        log.info('Sync local cache from S3 completed.')
809843
function VideoAsset(videoElement) {
  this._videoElement = null;
  this._destroyed = false;
  this._emitChange = this.emit.bind(this, 'change');
  this._lastTimestamp = -1;

  this._emptyCanvas = document.createElement('canvas');
  this._emptyCanvas.width = 1;
  this._emptyCanvas.height = 1;

  this.setVideo(videoElement);
}
1157170
def _update_metadata(self, kwargs=None):
        '''
        '''

        # If not given metadata, use instance.list to get it for container
        if kwargs == None and hasattr(self, 'name'):
            kwargs = self._list(self.name, quiet=True, return_json=True)

        # Add acceptable arguments
        for arg in ['pid', 'name']:

           # Skip over non-iterables:
           if arg in kwargs:
               setattr(self, arg, kwargs[arg])
       
        if "image" in kwargs:
            self._image = kwargs['image']
        elif "container_image" in kwargs:
            self._image = kwargs['container_image']
556444
def check_new_videos(self):
        """"""
        resp = api.request_videos(self.blink,
                                  time=self.blink.last_refresh,
                                  page=0)

        for camera in self.cameras.keys():
            self.motion[camera] = False

        try:
            info = resp['videos']
        except (KeyError, TypeError):
            _LOGGER.warning("Could not check for motion. Response: %s", resp)
            return False

        for entry in info:
            try:
                name = entry['camera_name']
                clip = entry['address']
                timestamp = entry['created_at']
                self.motion[name] = True
                self.last_record[name] = {'clip': clip, 'time': timestamp}
            except KeyError:
                _LOGGER.debug("No new videos since last refresh.")

        return True
683029
function _buildVideo(videoDescriptor) {
		this.url = videoDescriptor.url;
		this.appData = videoDescriptor.appData;
		descriptor = videoDescriptor;
	}
869111
def refresh(self, force_cache=False):
        """"""
        self.network_info = api.request_network_status(self.blink,
                                                       self.network_id)
        self.check_new_videos()
        for camera_name in self.cameras.keys():
            camera_id = self.cameras[camera_name].camera_id
            camera_info = self.get_camera_info(camera_id)
            self.cameras[camera_name].update(camera_info,
                                             force_cache=force_cache)
1245731
def update_metadata(ctx, archive_name):
    '''
    
    '''

    _generate_api(ctx)
    args, kwargs = _parse_args_and_kwargs(ctx.args)
    assert len(args) == 0, 'Unrecognized arguments: "{}"'.format(args)

    var = ctx.obj.api.get_archive(archive_name)

    var.update_metadata(metadata=kwargs)
990394
function (oldData) {
    var data = this.data;
    var camera = this.camera;

    // Update properties.
    camera.aspect = data.aspect || (window.innerWidth / window.innerHeight);
    camera.far = data.far;
    camera.fov = data.fov;
    camera.near = data.near;
    camera.zoom = data.zoom;
    camera.updateProjectionMatrix();

    this.updateActiveCamera(oldData);
    this.updateSpectatorCamera(oldData);
  }
786051
def update(self):
        """"""
        # For standalone and server modes
        # For each plugins, call the update method
        for p in self._plugins:
            if self._plugins[p].is_disable():
                # If current plugin is disable
                # then continue to next plugin
                continue
            # Update the stats...
            self._plugins[p].update()
            # ... the history
            self._plugins[p].update_stats_history()
            # ... and the views
            self._plugins[p].update_views()
650618
public void update ()
    {
        // grab the various system properties
        osName = System.getProperty("os.name");
        osVersion = System.getProperty("os.version");
        osArch = System.getProperty("os.arch");
        javaVersion = System.getProperty("java.version");
        javaVendor = System.getProperty("java.vendor");

        // determine memory usage
        Runtime rtime = Runtime.getRuntime();
        freeMemory = rtime.freeMemory() / 1024;
        totalMemory = rtime.totalMemory() / 1024;
        usedMemory = totalMemory - freeMemory;
        maxMemory = rtime.maxMemory() / 1024;

        // determine video display information
        isHeadless = GraphicsEnvironment.isHeadless();
        if (!isHeadless) {
            try {
                GraphicsEnvironment env =
                    GraphicsEnvironment.getLocalGraphicsEnvironment();
                GraphicsDevice gd = env.getDefaultScreenDevice();
                DisplayMode mode = gd.getDisplayMode();
                bitDepth = mode.getBitDepth();
                refreshRate = mode.getRefreshRate() / 1024;
                isFullScreen = (gd.getFullScreenWindow() != null);
                displayWidth = mode.getWidth();
                displayHeight = mode.getHeight();

            } catch (Throwable t) {
                isHeadless = true;
            }
        }
    }
837176
def update_metadata(self, archive_name, archive_metadata):
        '''
        
        '''

        required_metadata_keys = self.required_archive_metadata.keys()
        for key, val in archive_metadata.items():
            if key in required_metadata_keys and val is None:
                raise ValueError(
                    'Cannot remove required metadata attribute "{}"'.format(
                        key))

        self._update_metadata(archive_name, archive_metadata)
776068
def update_video(self, access_token, video_id, title=None,
                     tags=None, category=None, copyright_type=None,
                     public_type=None, watch_password=None,
                     description=None, thumbnail_seq=None):
        
        url = 'https://openapi.youku.com/v2/videos/update.json'
        data = {
            'client_id': self.client_id,
            'access_token': access_token,
            'video_id': video_id,
            'title': title,
            'tags': tags,
            'category': category,
            'copyright_type': copyright_type,
            'public_type': public_type,
            'watch_password': watch_password,
            'description': description,
            'thumbnail_seq': thumbnail_seq
        }
        data = remove_none_value(data)
        r = requests.post(url, data=data)
        check_error(r)
        return r.json()['id']
887069
def get_custom_metadata(self):
        
        if self.id is not None:
            data = self.connection.get_item(
                'find_video_by_id',
                video_id=self.id,
                video_fields="customFields"
            )
            for key in data.get("customFields", {}).keys():
                val = data["customFields"].get(key)
                if val is not None:
                    self.add_custom_metadata(key, val)